The story of Tamar and her father-in-law, Judah, Jacob's son, had married a Canaanite woman who bore him three boys -- Er, Onan, and Shelah. When Er grew up, Judah chose a wife for him. Her name was Tamar. Scripture does not say much about this woman of integrity. Apparently she was not Jewish, for she was not a descendant of Abraham, Isaac, and Jacob. What stands out most about her life is her character, not her lineage.
Tamar's marriage to Er ended quickly, "And Er, Judah's first born, was wicked in the sight of the Lord: and the Lord slew him" (38:7) Tamar was left childless.
Judah then commanded his second son, Onan to marry Tamar and have children on behalf of Er. This was commonly referred to as a Livirate marriage (Deut 25:5-6) a man would marry his brother's childless widow and have a son by her. The child would then be considered the son of the deceased brother, thus ensurring a continuation of the family line.
Onan obeyed his father -- partially. He married Tamar but because he knew the child would not be his, he took precautions to guarantee she would not conceive. The Hebrew text indicates that he did so repeatedly. "And the thing which he did displeased the LORD: wherefore he slew him also" (Gen. 38:10). Judah now had lost two sons. Fearing he might lose a third, he told Tamar to remain a widow and wait until Shelah grew up, at which time Shelah would take her as a wife, Tamar obeyed. The Bible does not say how many years she waited; but after a considerable time, Shelah grew up. It became apparent to Tamar that her father-in-law had no intention of marrying him to her. I speculate that he felt that he would lose that son also as he did the other two.
At that point, Tamar faced a dilemma. Should she concent to the moral degeneracy evidenced by Er, Onan, and Tudah and just forget the whole thing?? perhaps even marry into a completely different family? Or should she take matters into her own hands and do the right thing by trying to perpetuate Er's family line? She chose the latter. Many might say as a woman she overstepped her boundries, however, she had NO husband, she was trying to stay in submission to her Heavenly Father at this time.
Having heard that Judah had become a widower, she deceived him into believing she was a prostitute. Not recognizing her, Judah requested her services and paid her with his signet ring, among other things (38:18), later to be retrieved whith the payment of a goat. These were symbols of authority and marks of identification. But when Judah sent a Canaanite friend back with the goat and instructions to retrieve his belongings, the woman could not be found. In fact, nobody had even heard of her. Much to Judah's chagrin, he had to let the whole matter go, "lest we be shamed" (38:23). (To cover his OWN sin)
Three months later, Judah learned Tamar was pregnant. Since she was a widow and unmarried, everyone assumed she had acted immorally (funny how one is willing to cast a stone when they themselves live in a 'glass house'. Judah's judgment was severe and to the point: "Bring her forth, and let her be burned" (38:24).
But when Tamar arrived, Judah had a surprise waiting for him. "By the man, whose these are, am I with child: and she said, Discern, I pray thee, whose are these, the signet, and bracelets, and staff" (38:25).
Judah was caught red-handed. It was a shameful moment, somewhat like that of a later scene between King David and Nathan the prophet following David's sin with Bathsheba (2 Sam. 12:1-14). Like David, Judah had been quick to pronounce judgment on someone else until he was confronted with his own sin. To his credit, however, he acknowledged Tamar's virtue and the error of his own ways. "She hath been more righteous than I; because that I gave her not to Shelah, my son" (38:24). Judah released Tamar and did not have relations with her again.
For her righteous stand, God blessed her and gave her not one son, but twin sons-Perez and Zerah. In fact, the name of Perez became great in Israel and was later invoked as a channel of blessing in the book of Ruth: "And all the people who were in the gate, and the elders, said,.., let thy house be like the house of Perez, whom Tamar bore unto Judah" (Ruth 4:11-12). Most significantly, through the ancestry of Tamar and Perez, the Messianic line continued, culminating with Jesus Himself (Lk. 3:23-33)--a noble reward for a young woman who stood for what was right.