Genesis 4:11-14 gives an account of the dialog between the Lord and Cain and it is paraphrased below:
Lord: Cain, you are now cursed from the earth on which you shed your brother’s blood. Henceforth, the ground that was cursed to yield its produce when your parents (Adam and Eve) sinned shall refrain from yielding forth fruit, even with all your toil. You shall be a fugitive and a vagabond. 
Cain: My punishment is greater than I can bear. Look, I am driven from the face of the earth and your face shall be hid from me. Anyone who sees me shall slay me for I will be a fugitive and a vagabond. 

While on the surface, it may seem like, the Lord had dealt harshly with Cain, it is quite the contrary that is revealed when we delve deep into the Scripture. Cain complained, that his punishment was greater than he could bear. This reveals two things; first, Cain was unrepentant. Instead of confessing his sin and seeking the forgiveness of the Lord, he was focusing on himself and his punishment – the punishment that did not [actually] fit the crime. See, Cain had murdered his brother and according to the law of the Lord, given through Moses, the punishment would need to be equitable – eye for an eye, tooth for a tooth (Matthew 5:36) and in that same respect, that should mean hand for hand, foot for foot, and life for a life (Exodus 21:23-24). However, the law given through Moses, was not in effect yet, for this was before the days of Moses. Then what law (command) did Cain break? Cain broke the same command given to his father and mother, Adam and Eve, i.e, “You disobey God – you die (Genesis 2:16-17)” . Cain was given the option to heed to God’s voice and not let sin rule over him, but Cain willfully chose to disobey God and the wages of sin is death (Genesis 4:7; Romans 6:23). This means that the rightful punishment for Cain would have been “death” for his disobedience. So, herein comes the second revelation – God in his infinite mercy spare’s Cain’s life instead of taking it, as Cain had done of his brother Abel. Having said that, it is however, unfortunate that though Cain was spared physically, he was spiritually dead for his unrepentant heart and sin. His unconfessed sin would have God hide his face from Cain, for the Holiness of God can have nothing to do with unrighteousness (Genesis 4:14; 2 Corinthians 6:14).

Points to ponder:
When the Lord chastises us out of the abundance of his love for us (Hebrews 12:6), let us not be like Cain, complaining, that “our punishment is greater than we can bear”, but instead let us confess and repent of our evil ways. In reality, the our punishment from the Lord does not fit the crime of our disobedience. The punishment we deserved was placed on Jesus Christ, who was not a criminal, yet treated as one, so that we wont have to be. God is merciful, slow to anger, gracious and abounding in love (Psalm 145:8) and this is the reason why our punishment does not fit our crime, but he does expect us to be repentant, of our sinful ways, with a contrite heart (Psalm 51:17), lest we may be physically alive, but spiritually dead! Let not God have to hide his face from you and me, because of any unconfessed sin.

Genesis 4:11-14 (KJV)
11 And now art thou cursed from the earth, which hath opened her mouth to receive thy brother’s blood from thy hand;
12 When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth.
13 And Cain said unto the Lord, My punishment is greater than I can bear.
14 Behold, thou hast driven me out this day from the face of the earth; and from thy face shall I be hid; and I shall be a fugitive and a vagabond in the earth; and it shall come to pass, that every one that findeth me shall slay me.

Psalm 145:8 (KJV)
The Lord is gracious, and full of compassion; slow to anger, and of great mercy.