Matthew included five women in his genealogy of Christ. This is notable since it was not customary for Jews to include women in their records.
Even more remarkable is the fact that Matthew included some women who had disreputable histories. The five women included were: Tamar, Rahab, Ruth, Bathsheba, and Mary.
Tamar: Genesis 38:6-30
Tamar was the daughter-in-law of Judah. She was a childless widow, who was given to her brother-in-law after her husband's death. By this marriage, her offspring would continue the name and inheritance of the deceased. Such a union was later called a Leverite marriage (Deut 25:5-6).
Unfortunately, Tamar's brother-in-law refused to have proper intercourse with her. God killed him for this. Afterwards, Judah would not give Tamar to any of his other sons. So Tamar disguised herself as a harlot and seduced Judah. Through him, she became the mother of Perez.
Rahab: Joshua 2:1-24
Rahab was a harlot who lived in Jericho. She hid the spies of Joshua. Because of this, the Israelites spared her life when they conquered Jericho. She later became the wife of Salmon, and the mother of Boaz. Rahab's faith was later commended (Heb 11:30-31).
Ruth: Ruth 1:1-4:22
Ruth was a foreigner from the land of Moab. She was the widow of a Jew. Her mother-in-law, Naomi, also lived in Moab. Naomi journeyed to Israel after her family died. Ruth's devotion was extraordinary. She left her own country to follow Naomi.
While in Israel, Ruth was married to Boaz, one of Naomi's relatives. Ruth later became the mother of Obed, the grandfather of David the King.
Bathsheba: 2 Samuel 11:1-27
Bathsheba was the wife of Uriah the Hittite, who was a soldier in the army of King David. She and David had an adulterous affair.
When David discovered Bathsheba was pregnant, he tried to cover it up by summoning Uriah home from war, hoping that Uriah would have intercourse with his wife. Uriah came home to Jerusalem, but refused to lay with Bathsheba as long as the armies of Israel were at war.
So, David sent Uriah back into battle, with orders that Uriah should be withdrawn from when the fighting became fierce. After Uriah was slain in this manner, David took Bathsheba as his own wife. God punished them for this by killing their first child.
Bathsheba later became the mother of Solomon.
Mary: Matthew 1:18-25, Luke 1:26-56
Mary was the mother of Jesus and the wife of Joseph. She was a virgin when Jesus was conceived by the Holy Spirit.
Joseph was betrothed to Mary when he discovered she was pregnant. He intended to put her away secretly because this was shameful. However, an angel told Joseph what had happened. So Joseph took Mary as his wife, and kept her as a virgin until she gave birth to Jesus.
During her pregnancy, Mary spent time with her relative Elizabeth, who was the mother of John the Baptist (Luke 1:39-56). Mary was not a perpetual virgin, as she later became the mother of other sons and daughters (Matthew 13:55-56).
Mary was a widow at the time of Jesus' death. While on the cross, Jesus committed her to the care of John, his apostle (John 19:25-27).