From Matthew 1:5, footnotes 1 & 3 in the RcV, concerning Rahab and Ruth in relation to the genealogy of Christ:
Rahab was a prostitute in Jericho (Josh. 2:1), a place cursed by God for eternity (Josh. 6:26). After she turned to God and God’s people (Josh. 6:22-23, 25; Heb. 11:31) and married Salmon, a leader of Judah, the leading tribe (1 Chron. 2:10-11), she brought forth Boaz, a godly man, out of whom Christ came. Regardless of our background, if we turn to God and His people and are joined to the proper person among God’s people, we will bring forth proper fruit and participate in the enjoyment of the birthright of Christ (note 1).
The origin of Ruth was incest, for she belonged to the tribe of Moab (Ruth 1:4), the fruit of Lot’s incestuous union with his daughter (Gen. 19:30-38). Deuteronomy 23:3 forbade the Moabites to enter the assembly of Jehovah, even to the tenth generation. Ruth, however, not only was accepted by the Lord but also became one of the most important ancestors of Christ because she sought God and God’s people (Ruth 1:15-17; 2:11-12). Regardless of who we are and what our background is, as long as we have a heart that seeks God and His people, we are in a position to be accepted into the birthright of Christ (note 3).
I’ve read over these notes countless times, and still, I never fail to appreciate them each time. As we grow older and realize more of who and what we are, these footnotes are even more a consolation and encouragement. What mercy, that in spite of it all, when we turn to God, we can still be a factor to usher Christ in.