“secretly sent two men.” Joshua sent the spies secretly, without telling the Israelites what he was doing. Some 40 years earlier, when Moses sent spies into the Promised Land, all Israel knew they were going. But when they came back they brought an evil report and discouraged the people (Num. 13). The result of that evil report was that the people of Israel grumbled about Moses and spoke of stoning him, and finally God intervened and said He would not let that generation go into the Promised Land, which is why Israel wandered in the desert for 40 years (Num. 14). Joshua did not want any kind of a repeat of that event, so he sent the spies secretly, not telling the people of Israel he had sent them.
It is possible to translate the Hebrew that Joshua “had sent” the spies out, which might make the timing of the three days easier to understand.
“out from Shittim.” The name “Shittim” means “Acacias,” and it is also called Abel-shittim (Num. 25:1, 33:49, Acacias Meadow). The biblical city of Shittim is almost certainly the archaeological site of Tel el-Hamman, the site of a huge Canaanite city (cp. Num. 25:1; 33:49). It is in the plains of Moab across from Jericho.
“the house.” The fact that the men from Israel went right into her house indicates that her house also was a local inn, and that fits with Rahab being a prostitute. It was common in the ancient world, and widely practiced in New Testament Greece and Rome, that one of the services provided by inns was the availability of a prostitute. Often he or she was a slave who had little or no choice in the matter.
“a prostitute whose name was Rahab.” Although Rahab was a Canaanite, she believed in Yahweh (Josh. 2:9-13) even if she believed in her own gods as well. Rahab is praised in the New Testament in Hebrews 11:31 and James 2:25. Because she hid the spies from Israel, she and her family were saved from the destruction of Jericho (Josh. 6:22-25), and she then married Salmon of the line of Judah and became part of the genealogy of Jesus Christ (Ruth 4:20-21; Matt. 1:5). The fact that Rahab went from Canaanite prostitute to an ancestor of Jesus Christ shows how God can redeem and elevate people’s lives if they trust Him.
“they lay down there.” The spies rested in Rahab’s house. The Hebrew text uses ambiguous vocabulary that can sometimes mean to have sex with, but that is not its meaning here. The vocabulary pulls you into the story.