In listing the ancestors of Christ, Matthew brings forth a large variety of figures, among whom we read, “and Salmon the father of Boaz by Rahab, and Boaz the father of Obed by Ruth, and Obed the father of Jesse” (Matt. 1:5 RSV).
Rahab is one of the few women Matthew places into Jesus’ lineage. Indeed, when we read the genealogy of Christ in Matthew, there are many who we know who could be included, like Sarah, but are not mentioned, while those many of the Jews would consider to be outsiders were specifically mentioned as being a part of his holy family line. St. John Chrysostom saw this as indicating the way Christ is to draw all people into him, so that there is no longer to be a division between Jew and Gentile, that the whole world is to be restored by Christ, the whole of humanity healed from the wound of sin:
Do you see that it was not for few nor small causes that he brought to our remembrance the whole history concerning Judah? For this end he has mentioned Ruth also and Rahab, the one an alien, the other an harlot, that you may learn that He came to do away with all our ills. For He has come as a Physician, not as a Judge. Therefore in like manner as those of old took harlots for wives, even so God too espoused unto Himself the nature which had played the harlot: and this also prophets from the beginning declare to have taken place with respect to the Synagogue. But that spouse was ungrateful towards Him who had been an husband to her, whereas, the Church, when once delivered from the evils received from our fathers, continued to embrace the Bridegroom.
Matthew is specifically interested in showing to us that a former prostitute and outsider to the people of Israel was brought into the holy line of Christ. Through her, we find that God was at work preparing the world for the incarnation. The holy one of God, the son of Man, the messiah, is descended not only through the men and women who showed an external sense of piety and was approved by the priests and scribes of Israel because of their external forms of reverence, but also through those who had attained true peace with God by a higher form of piety. Thus, we find ourselves having to consider Rahab the holy prostitute, and what she represents to us in our walk with God. From her example, we are shown that the dividing line, the wall of sin which distinguishes a sinner and saint, is laid siege by the grace of God. Grace can be smuggled in behind the scenes and transform those who find it and accept it into great saints no matter what their way of life might have been.
Yet, we can say that God worked with prostitutes and outsiders, those the Jews would normally frown upon, to level off their pride. He wanted them to know that he was at work, not just with those who were of the people of Israel, of those among the people of Israel who gave the appearance of being holy, but with all, including those which seemed to be far outside of the covenantal relationship with God. Indeed, God hid himself, brought himself into the world, in a holy line which hid its holiness through the appearance of sin which many in that line were known to have committed. God hid the development which was taking place in humanity by having those who had an unholy appearance hide the holiness which was developing within them and their line so that after a long battle, God could enter behind enemy lines, God could come in behind the walls of sin and break down those walls from within the domain of sin.