Genesis 38:6

And Judah took a wife for Er his firstborn, whose name was Tamar.

The verse names Tamar as the woman Judah took as wife for Er his firstborn, opening the Judah-Tamar history that sets the stage for her later conduct with her father-in-law. It belongs to the chapter that records the sin of Judah and his family, occurring after Joseph was sold into Egypt and within the thirteen years before Pharaoh's dreams, Joseph's interpretation of them, and his exaltation to save Israel. It stands in the first part of the story of Joseph and his brethren in Genesis 37-44, which traces the brothers' hatred of Joseph to their attempt to slay him and their selling him as a slave into Egypt, displays the integrity and purity instilled in Joseph, follows him through two years in prison though innocent of crime into his call to the throne of Egypt, and brings his brethren unknowingly to bow humbly before him in fulfillment of the dreams that had aroused their envy. The surrounding account reveals Jacob as a loving but unwise father who favored Joseph as the petted child of his old age and the son of his favorite wife. It exposes the evils and sad fruits of having more than one wife in partiality, jealousies between wives and between their families, envy, low moral standards, and crime.

The verse belongs to an account of the duty of a goel, or nearest kinsman, to preserve a deceased relative's name and inheritance by providing an heir. The penalty visited on Er shows the Lord's displeasure with a man who shirked that duty, while Tamar's actions to secure the rights Judah had fraudulently denied her were less reprehensible in light of that law and custom. The record of that sin is meant to expose wrongdoing so that people may shun it, not to indulge or excuse it, and it also reveals God's remedy through his love, mercy, and power.

The verse is part of the account of Judah's family from which Pharez came, and the sons born of the union were counted as legitimate, with Pharez, whose birth is described as coming from harlotry, included as an ancestor of Jesus Christ. That human line from which Christ came according to the flesh was sinful and degraded, joining the selfishness, craftiness and deceit of Jacob and his sons to harlotry, heathenism, weakness and idolatry in the lines of Judah, David and Solomon. That ancestry concentrated in Christ all the weaknesses and sinful tendencies of fallen humanity, and his flesh was that of sinful man and not of a sinless being. This was necessary so death could have power over him and so he could suffer being tempted and be able to sympathize with and succor tempted men in order to redeem them.