The Gemara infers from these words that not only were they in great fear, but they also lost their virility. Rahab could report this because of the relationships she had with these princes and rulers. The Gemara also states that she was 10 years old at the time of the Exodus, and she conducted illicit relationships for the 40 years Israel wandered in the desert. At age 50 she converted, saying, “Let me be forgiven as a reward for the rope, the window, and the flax.” Rashi cites a passage in the Mechilta (Parshat Yitro) that states that she argued: “Let me be forgiven for the three things I have used in sinning.” The three things were the rope her paramours used to climb up to her, the window they used for entry, and the flax stalks she used to hide them. She used these same three items to hide Joshua’s messengers and help them escape.
As to the source that Rahab married Joshua, we refer to Tractate Megilla (14b), where R. Nachman states that Hulda the prophetess was a descendant of Joshua’s, as we see from two verses. One verse, referring to Hulda (II Kings 22:14), reads, “The son of Har’has,” and another verse (Judges 2:9) states that Joshua was buried in “Timnat-Heres.”
The Gemara cites an objection to R. Nahman’s statement: R. Ena Saba notes that “there were eight prophets who were descended from Rahab – Neriah, Baruch, Serayah, Mahseyah, Jeremiah, Hilkiah, Hanamel and Shalum.” R. Yehuda says that Hulda the prophetess was also a descendant of Rahab since II Kings 22:14 states, “Hulda the prophetess, the wife of Shalum, son of Tikva (ben tikva)” and Joshua 2:18, referring to Rahab, states, “Et tikvat chut hashani – this cord of scarlet thread.” These verses indicate that Hulda was Rahab’s descendant, not Joshua’s.
R. Nahman replies to this objection by stating, “Ena Saba [some say he addressed him as “patya uchma – black bowl,” which the Maharsha considers a compliment], we can deduce from both our statements that Rahab converted and married Joshua.”
The Gemara concludes that even though I Chronicles 7:27 states, “Non beno, Yehoshua beno – Non [Nun] his son, Joshua his son,” which implies that the genealogy ended with Joshua – who had no descendants – that verse is only referring to male progeny. Joshua did, however, have daughters from whom Hulda the prophetess is descended.
Before we address your question – How could Joshua have married a harlot? – we must tackle an even greater difficulty. Deuteronomy 20:16 states clearly: “Rak me’arei ha’amim ha’eleh asher Hashem Elokecha noten lecha nachala lo techayyeh kol neshama – But of the cities of these nations which Hashem your G-d has given to you as an inheritance you shall not leave any soul alive.” The Rambam (Hilchot Melachim 5:4) sees this verse as a command us to kill all souls from the seven Canaanite nations. One who has the opportunity to do so but does not is in violation of a prohibitory command, number 49 in the Rambam’s Sefer HaMitzvot.
Rahab was a member of the Canaanite nation; so how could Joshua allow her to live, let alone marry her?
(To be continued)