Midrash Rabbah - Genesis XXXVI:7

7. AND NOAH AWOKE FROM HIS WINE (IX, 24): he was sobered from his wine. AND KNEW WHAT HIS YOUNGEST SON HAD DONE UNTO HIM. Here it means, his worthless son, as you read, Because the brazen altar that was before the Lord was too little to recelve the burnt- offering, etc. (I Kings VIII, 64).(1). AND HE SAID: CURSED BE CANAAN (IX, 25): Ham sinned and Canaan is cursed! R. Judah and R. Nehemiah disagreed. R. Judah said: Since it is written, And God blessed Noah and his sons (Gen. IX, 1), while there cannot be a curse where a blessing has been given, consequently, HE SAID: CURSED BE CANAAN. R. Nehemiah explained: It was Canaan who saw it [in the first place] and informed them, therefore the curse is attached to him who did wrong. R. Berekiah said: Noah grieved very much in the Ark that he had no young son to wait on him, and declared, ' When I go out I will beget a young son to do this for me.’ But when Ham acted thus to him, he exclaimed, ' You have prevented me from begetting a young son to serve me,(2) therefore that man [your son] will be a servant to his brethren!’ R. Huna said in R. Joseph's name: [Noah declared], ‘You have prevented me from begetting a fourth son, therefore I curse your fourth son.’(3) R. Huna also said in R. Joseph's name: You have prevented me from doing something in the dark [sc. cohabitation], therefore your seed will be ugly and dark-skinned. R. Hiyya said: Ham and the dog copulated in the Ark, therefore Ham came forth black-skinned while the dog publicly exposes its copulation. R. Levi said: This may be compared to one who minted his own coinage(4) in the very palace of the king, whereupon the king ordered: I decree that his effigy be defaced and his coinage cancelled. Similarly, Ham and the dog copulated in the Ark and were punished.(5)

(1) Katon is used in both verses, in the second in the sense that it was too small and consequently unfit; v. Zeb. 59b. Ham was actually not the youngest son, as appears from the order, Shem, Ham. and Japheth.

(2) According to the Rabbis he castrated him.

(3) Sc. Canaan; V. X, 6.

(4) Coins bearing his own effigy.

(5) Copulating in the Ark is compared to minting one's coinage (producing offspring in one's own image) in the King's (i.e. God's) own house.

This extract is from the Soncino Classics Collection, Judaic Classics Library CD-ROM, 1995, Davka Corporation, Chicago, USA.