There is a literal scarlet thread in the book of Joshua which ties into the theme of the Scarlet Thread. As the Israelites were preparing to take Jericho by force, they sent spies into town. The spies stayed hidden in the house of a harlot named Rahab. At the end of the spies’ stay with Rahab, an extraordinary interaction occurred.
“I know that the LORD has given you the land, and that the terror of you has fallen on us, and that all the inhabitants of the land have melted away before you. For we have heard how the LORD dried up the water of the Red Sea before you when you came out of Egypt, and what you did to the two kings of the Amorites who were beyond the Jordan, to Sihon and Og, whom you utterly destroyed. When we heard it, our hearts melted and no courage remained in any man any longer because of you; for the LORD your God, He is God in heaven above and on earth beneath. Now therefore, please swear to me by the LORD, since I have dealt kindly with you, that you also will deal kindly with my father’s household, and give me a pledge of truth, and spare my father and my mother and my brothers and my sisters, with all who belong to them, and deliver our lives from death.” So the men said to her, “Our life for yours if you do not tell this business of ours; and it shall come about when the LORD gives us the land that we will deal kindly and faithfully with you.” Then she let them down by a rope through the window, for her house was on the city wall, so that she was living on the wall. She said to them, “Go to the hill country, so that the pursuers will not happen upon you, and hide yourselves there for three days until the pursuers return. Then afterward you may go on your way.” The men said to her, “We shall be free from this oath to you which you have made us swear, unless, when we come into the land, you tie this cord of scarlet thread in the window through which you let us down, and gather to yourself into the house your father and your mother and your brothers and all your father’s household. It shall come about that anyone who goes out of the doors of your house into the street, his blood shall be on his own head, and we shall be free; but anyone who is with you in the house, his blood shall be on our head if a hand is laid on him. But if you tell this business of ours, then we shall be free from the oath which you have made us swear.” She said, “According to your words, so be it.” So she sent them away, and they departed; and she tied the scarlet cord in the window. Joshua 2: 9 – 21
Just like the Passover, just like Moses and the serpent in the wilderness, this account of Rahab the harlot foreshadows elements of the gospel; salvation from the coming wrath was achieved through faith.
By faith Rahab the harlot did not perish along with those who were disobedient, after she had welcomed the spies in peace. Hebrews 11: 31
Yet Rahab did more than serve as a participant in the prophetic foreshadow of the gospel. She literally participated in the extension of the line of Judah, and paved the way for the line of David, for she was the mother of Boaz, who was an ancestor of King David.
Salmon was the father of Boaz by Rahab, Boaz was the father of Obed by Ruth, and Obed the father of Jesse. Jesse was the father of David the king. Matthew 1: 5 – 6
Rahab’s participation in extending the line of Judah and establishing the line of David is significant because the Old Testament Scriptures teach that the Messiah would be from the line of David.
For a child will be born to us, a son will be given to us; and the government will rest on His shoulders; and His name will be called Wonderful Counselor, Mighty God, Eternal Father, Prince of Peace. There will be no end to the increase of His government or of peace, on the throne of David and over his kingdom, to establish it and to uphold it with justice and righteousness from then on and forevermore. The zeal of the LORD of hosts will accomplish this. Isaiah 9: 6 – 7
And the New Testament teaches that Jesus of Nazareth, the Messiah, is a Son of David.
Now the birth of Jesus Christ was as follows: when His mother Mary had been betrothed to Joseph, before they came together she was found to be with child by the Holy Spirit. And Joseph her husband, being a righteous man and not wanting to disgrace her, planned to send her away secretly. But when he had considered this, behold, an angel of the Lord appeared to him in a dream, saying, “Joseph, son of David, do not be afraid to take Mary as your wife; for the Child who has been conceived in her is of the Holy Spirit. She will bear a Son; and you shall call His name Jesus, for He will save His people from their sins.” Now all this took place to fulfill what was spoken by the Lord through the prophet: “Behold, the virgin shall be with child and shall bear a Son, and they shall call His name Immanuel,” which translated means, “God with us.” And Joseph awoke from his sleep and did as the angel of the Lord commanded him, and took Mary as his wife, but kept her a virgin until she gave birth to a Son; and he called His name Jesus. Matthew 1: 18 – 25