The first step in preparation for war was the selection of spies. To guard against a repetition of what had happened to Moses, Joshua chose as his messengers Caleb and Phinehas, on whom he could place dependence in all circumstances. They were accompanied on their mission by two demons, the husbands of the she-devils Lilith and Mahlah. When Joshua was planning his campaign, these devils offered their services to him; they proposed that they be sent out to reconnoitre the land.
Joshua refused the offer, but formed their appearance so frightfully that the residents of Jericho were struck with fear of them. In Jericho the spies put up with Rahab. She had been leading an immoral life for forty years, but at the approach of Israel, she paid homage to the true God, lived the life of a pious convert, and, as the wife of Joshua, became the ancestress of eight prophets and of the prophetess Huldah.
She had opportunity in her own house of beholding the wonders of God. When the king's bailiffs came to make their investigations, and Rahab wanted to conceal the Israelitish spies, Phinehas calmed her with the words: "I am a priest, and priests are like angels, visible when they wish to be seen, invisible when they do not wish to be seen."