Who was Rahab?
In the Hebrew Bible or Christian Old Testament, Rahab was a harlot of Jericho who received Joshua's spies. She had a house of her own, separate from her father, mother, brothers, and sisters; perhaps a lodging convenient for travelers, being situated on the wall.
The flax she spread on her roof and the scarlet line make it likely she manufactured linen and dyed, as did the Phoenicians; compare Josh. 7:21 the "Babylonian garment," implying a trade in such articles with Mesopotamia. Jericho, near the fords of Jordan, would be an emporium between Phoenicia and Babylon and Egypt. Hence, Rahab knew the facts of the exodus, the miraculous passage of the Red Sea, and the overthrow of Sihon and Og.
God made the truth bring the conviction to her mind that Israel would conquer Canaan, and that "Jehovah Israel's God is God in heaven above and in earth beneath." Faith induced her, at the risk of her life, to shelter the spies under the stalks of flax spread on the flat roof. Her deceiving the king of Jericho and saying they had "gone she knew not where" is not commended in Scripture, but only the faith which was the mainspring of her conduct. Scripture forbids a lie, or any "evil doing, that good may come" (Rom. 3:7,8).
Next, she told them of the panic which Israel's advance caused among her countrymen, and obtained from them the promise that when Israel took Jericho she and her father, mother, brethren, and sisters, and all of the household, should be saved; the scarlet line by which they were let down from her window in the wall was the pledge, placed in the window. By her counsel they hid three days in the mountains (Quarantana, abounding in caves, a wall of rock rising 1,200 ft. precipitously) bounding the Jericho plain on the N.; and when the pursuers had returned, and the Jordan fords were clear, they escaped back to Israel's camp.
Their news must have much encouraged the army. Joshua faithfully kept the promise to her at the destruction of Jericho, causing the two spies to bring out Rahab and all her kindred from her house, which was under the protection of the scarlet line.
Salmon, then a youth, who married her, was probably one of the two whom she had saved, gratitude leading on to love and erasing the remembrance of her former life of shame. Her faith was richly rewarded, she becoming mother of Boaz (Ruth 4:21), an ancestress of Messiah; one of the four women, all foreigners -- Tamar, Rahab, Ruth, and Bathsheba -- named in Matthew's genealogy (Mt. 1:5). In it "none of the holy women are included, only those whom the Scriptures blame, in order that He who came in behalf of sinners, being Himself born of sinners, might destroy the sins of all" (Jerome).
Possibly the 345 "children of Jericho" were posterity of her kindred, settled in Israel (Ezra 2:34; Neh. 3:2). Harlotry was not counted "sin" among the pagan, though not respectable; but when she adopted a pure faith she began a pure life. Believing knowledge of God's purpose concerning Israel and Jericho made her renounce the lower duty, patriotism, for the higher one, piety; she could only have been faithful to her country by unfaithfulness to her God.
She renounced the pollution of her country's gods, with which her own harlotry may have been connected, to join Jehovah and His people. Her provision for her parents' and relatives' safety shows that self was not her sole consideration.
Her hospitality to the spies was for their Lord's sake (Mt. 10:40-42). Heb. 11:31: "by faith the harlot Rahab perished not with them that disobeyed not (apeitheesasin, God's will manifested by miracles in Israel's behalf) when she had received the spies in peace," i.e. securing them from hurt. The season, as otherwise comes out, was four days before Passover, "on the tenth day of the first month," barley harvest time, when Jordan periodically overflowed its banks.
The flax harvest was simultaneous with barley harvest, it appears from Exo. 9:31. In undesigned coincidence with these casual notices, Rahab "hid the spies with the stalks of flax," doubtless just cut down and spread on the roof of her house (Josh. 2:6; 3:15; 4:19; 5:10,11).
Paul quotes Rahab as exemplifying "faith"; James (James 2:25) quotes Rahab as exemplifying justification by works evidentially. Therefore, Paul's justification by faith alone means a faith, not dead, but working by love (Gal. 5:6). Again, Rahab's act cannot prove justification by works as such, for she was a woman of bad character. But as an example of grace, justifying through an operative as opposed to mere verbal faith, none could be more suitable than the saved "harlot."
She believed, so as to act on her belief, what her countrymen disbelieved; and this in the face of every improbability that an unwarlike force would conquer a well-armed one, far more numerous. She believed with the heart (Rom. 10:9,10), confessed with the mouth, and acted on her profession at the risk of her life. A woman of loose life, and a Gentile, is justified even as Abraham, the father of the Jews, the friend of God, was; showing that justifying, working faith manifests itself in every class.
The nature of the works alleged, not works of charity and virtue, but works the value of which consists in their being proofs of faith, proves that James quotes them as evidences of faith, faith expressed in act. We are "justified by works" in the sense that we are justified by a faith which always works where it has the opportunity. The scarlet line typifies Jesus' blood, that secures from wrath the Gentiles and even harlots and notorious sinners (Mt. 21:31,32), within His church, even as the sprinkled blood of the paschal lamb secured Israel in their houses, and typified the same all-atoning blood. Rahab is an instance of the call of Gentiles anticipatory of that under the gospel.
IBSE, (in the public domain) with minor edits.