Several of the readers have written in asking about Rahab and her story in the Book of Joshua. Here is a good summary:
A Canaanite woman living in Jericho, Rahab is a prostitute who is also a biblical heroine. According to the narrative in Joshua 2, before the conquest of Canaan, Joshua sends two men as spies to see the land. They come to Rahab’s house for lodging, information, and/or sex. The king, hearing about the two men, demands that Rahab give them up. Like the midwives in Egypt, Rahab is faced with a “moment of truth.” Like them, Rahab defies the ruler and rescues the Israelites. She tells the king’s men that the two men have left and that the king’s men should chase them. Meanwhile, she has hidden the men under the flax drying on her roof (2:4); the writer uses the unusual word tizpeno, “she hid him” (even though there are two men), perhaps as an allusion to Exod 2:2, where Moses’s mother hides her newborn (tizpenehu). Rahab is midwife and mother to Israel in its beginnings in Canaan.
Rahab lets the two men out through her window, which is in the town wall. She requests a return for her act of hesed (“special benevolence”: NRSV, “I have dealt kindly”). She asks that she and her family be spared once the Israelites attack Jericho. The spies give her a crimson thread to hang from her window, with the injunction that she is to gather her family and wait inside her house; as long as they stay indoors, they will be spared. When the Israelites destroy Jericho, as described in Joshua, Rahab and her whole extended family indeed escape doom by waiting inside a house marked with a red thread, just as the Israelites who stayed in houses marked with the blood of the paschal lamb were spared the fate of the Egyptians. They are exempted from the herem, Israel’s obligation to destroy all Canaanites (see 6:17), and are brought out of the city to live “in Israel ever since” (6:25). Rahab and her family are a new Israel.
Rahab has a special function in the biblical narratives of Israel’s existence in the land. When uncovering the men, she explains that she knows that God will give Israel the land (2:8). She has heard about the events of the Red Sea and the defeat of the Amorite kings Og and Sihon, and she declares (quoting from the Song of Miriam in Exodus 15; see v. 11) that “dread” has fallen on the inhabitants and that they all “fear” Israel (2:9). This is the message that the men bring back to Joshua. Rahab is thus the oracle of Israel’s occupation of the land. Another woman, the prophet Deborah, announced a major victory in the taking of Canaan; and the end of Israel’s occupation of the land is pronounced by yet another woman, the prophet Huldah. Rahab, who begins as triply marginalized—Canaanite, woman, and prostitute—moves to the center as bearer of a divine message and herald of Israel in its new land. Even though later generations of readers have been squeamish about her occupation, preferring to think of her as an “innkeeper,” she is remembered in Jewish tradition as the great proselyte, as ancestress of kings and prophets, and, in the New Testament, as ancestress of Jesus.