Her appearance in the Biblical story is unexpected and even shocking. She sold her body to men for sex. It's not dressed up nicely or discretely hinted at (the author was not, after all, English), we are told boldly and plainly Rahab was a prostitute.
Joshua 1:1-24 tells the story. This woman who knew well the realities and lies of the human heart for she dealt with it every day recognised the one true God when she heard about him. She calls Him by His covenantal name (the LORD) and rather than her heart 'melting' like her fellow citizens in Jericho, she begs mercy and finds grace: not only for herself but her kin.
Jericho falls, at God's command and in God's power. The God of the Covenant displays to the People of His Promise, Israel, that the completion of covenantal blessing does not rest in their might but in Him, The Almighty. Jericho is destroyed in God's justice but we also see salvation and hope.
Rahab and her entire family are saved (Joshua 6:22-25) by a thin red line of cloth and the faith response that it indicated. Rahab is exalted as an example of the people of faith (Hebrews 11:30-31). Matthew's gospel mentions a Rahab as the mother of Boaz in the lineage of Jesus (Matthew 1:5). Some have argued that this is not THE Rahab of Joshua but of another time: I fail to understand how Matthew would have mentioned another Rahab, another woman, who does not appear in Scripture (he also mentions Bathsheba - another 'dishonoured' woman) in the lineage of Jesus.
It is unexpected and even shocking that a non-Jewish female prostitute should make an positive appearance in the Bible at all. It is breathtaking that the God of Holiness, of all purity, should accept her into His people - not by virtue of her birth, nor any virtue at all, but by her faith! She like the forefathers and foremothers of faith believed God and it was credited to her as righteousness.
The human genetics of Jesus, the child of Bethlehem, the man of Gethsemane, Golgotha and resurrection Garden, is not some magically 'pure' lineage. He is fully human: this child had no shining halo, no iridescent face. He acts the one and only mediator between God and people, precisely because he is fully human and fully God. The outward eye sees only a neo-natal child, a descendant of Abraham, Isaac and Jacob, a son of Israel, one of the many.
But this one is The One that the sons and daughters of Israel have been waiting for. The One in whom the dawn of redeeming grace is born: Jesus, the Christ and Saviour! His life will redeem many from every nation and every sphere of life. This child has kings and queens in his lineage as well as liars, fraudsters, idolaters, God haters and even prostitutes. And so after him and through him will alone can people of all kinds and all races come to know God through believing Him.