
The operation is underway. The operatives - two spies from the Israelites' camp. This will give them information needed to conquer the land.

One may think... "Wait a minute. Doesn't this move sound familiar? Four decades ago in Numbers 13, Moses sent 12 spies to Canaan, and only (a much-younger) Joshua & Caleb came back with a favourable Minority Report?" And we all know that the Israelites believed the majority report of the 10 unbelieving spies, and alas, everyone had to wander the desert till the entire generation died. In a span of 40 years.
We must understand, that in Numbers 13, the Israelites' motivation for the spying trip was based on their lack of belief. Compare it with Deut 1:21-23. Acting on unbelief yielded disastrous results.

This time is different. In Joshua 2, the spies were sent out as part of a military strategy which was common in its day. We see a totally different attitude here. And the difference was belief. Faith in God does not just wait for the promise to be plopped on one's lap. Man's responsibility and God's sovereignty work in tandem to achieve God's purposes.
Chapter 2
Observations

V2 - v7 - the spies on assignment lodged at the house of Rahab, a prostitute. It was probably the epicenter of news and happenings, where they could gather much "from the ground". However, their presence did not go unnoticed. The King of Jericho sniffed them out, and ordered Rahab to cough them out. Rahab, in a surprising move, not only protected the enemy spies, but helped them escape and sent her King's men on a wild goose chase in the opposite direction! One may wonder what had possessed her to do that. After all, isn't she a harlot... with a dubious moral persuasion?

v8 explains it. Rahab said, "I know the the LORD...." Rahab referred to Yahweh, which indicated that she had come to faith in the living God (v 11). God had graciously opened the heart of a pagan prostitute to accept Him as Lord. And besides, Rahab and all of the people in her land are melting in fear because they heard of what Yahweh had done in the desert 40 years ago - parting the Red Sea, providing manna, pillar of fire by night and cloud by day, etc etc!

When God deals with believers, our lives are on display to an unbelieving world; so that they too can see the workings of the living God and come to faith in Him.

Lest we wonder why God would choose to include a prostitute in such an important role in history, let's not forget that we are all harlots - according to Hosea. We just sell ourselves to different masters.

Then it gets better. Rahab lies in order to save the spies in V4. So now, is lying an acceptable course of action to fulfill God's plan? For a greater good? To prevent a greater evil?

The Bible clearly condemns lying (Ex 20:16, Jer 9:4-9, Zech 8:16, Eph 4:25). This is told by God Himself, who cannot lie (Num 23:19). But Rahab had been praised for her actions (Josh 6:22-25, Heb 11:31, James 2:25).
And her actions made her an ancestor to the Lord Jesus (Matt 1:5)
Either her lie was:
1. not a sin
2. a sin that was excusable
3. a sin that was not excusable.

#1 will say that sometimes, "the loving thing" is all that matters, ie, a "little lie" told in the name of love is no sin. In fact, it is the right thing to do.

#2 says that the lie is excusable because of a greater value - the lives of the spies were at stake. Those who hold this view believes that some sins are worse than others, and sometimes a person has to choose among them. In Rahab's case, the necessity of saving the lives of the spies has a higher value than truth.

#3 says... a lie is a lie. Rahab's action was wrong. Rahab has sinned no matter how noble her intentions were. However, her sin is understandable because she lacked knowledge of Yahweh. She did wrong but she did not know any better.
Thoughts

We must be careful to make a distinction between Rahab's faith and the way she expressed it. The Bible praises Rahab for her faith, not because of her lying. Her actions would have been more noble had she protected the spies in some other fashion, but as it was, she did the best she could. She believed in God and strove to honour Him and His people. That is what draws her praise. (Nelson's NKJV)
...