Rahab, (Heb. rachav; i.e., "broad," "large") was a prostitute who lived in the city of Jericho in the Promised Land, according to the book of Joshua.
According to the book of Joshua (Joshua 2:1-7), when the Hebrews were encamped at Shittim, in the "Arabah" or Jordan valley opposite Jericho, ready to cross the river, Joshua, as a final preparation, sent out two spies to investigate the military strength of Jericho. The spies stayed in Rahab's house, which was built into the city wall. When soldiers of the city guard came to look for them, she hid them under bundles of flax on the roof and pretended that they were not there in order to prevent them from being captured. She said, essentially, "They went thataway." The soldiers did, too; and the spies escaped. They promised to spare Rahab and her family after taking the city, even if there should be a massacre, if she would mark her house by dangling a red cord out the window.
When the city of Jericho fell (Joshua 6:17-25), Rahab and her whole family were preserved according to the promise of the spies, and were incorporated among the Jewish people. She afterwards became the wife of Salmon, a prince of the tribe of Judah (Ruth 4:21; 1 Chr. 2:11). Whith him she have the son Boaz, which becomes an ancestor of David.
Rahab is curious ethically: not only did she follow a profession that is deprecated in Judaic Law--although not totally condemned--but she has mixed allegiance: She betrays her own city (which may or may not be ruled by a tyrant); and she buys favorable treatment for her own family by doing so. In so doing, she gains a place of honor in Scripture.
This entry incorporates text from the public domain Easton's Bible Dictionary, originally published in 1897.
Rahab is also mentioned in the Genealogy of Jesus in the Gospel of Matthew as one of the ancestors of Jesus. In the King James version of this genealogy, her name is spelled Rachab. Subsequent mentions are as an example of a person of faith (Hebrews 11:31) and good works (James 2:25).
Rahab identified her house with a scarlet cord. According to some, this was later adapted by prostitutes to become a red light that was placed at their windows to indicate the nature of their business to potential customers.
Rahab's story is possibly the inspiration for the euphemism "the world's oldest profession" for prostitution.
Some have theorized that the Rahab described in Joshua is not the same person as the Rachab mentioned in Jesus Christ's genealogy. This is based on linguistic and textual evidence.