I was considering giving a bit of the standard talk about how the Hebrew word used here is questioned by some who believe that there is possibility that Rahab was not a prostitute, but an innkeeper. Sure, translation can be difficult at times, and it may be that the ambiguity is real, but then, one still has to wonder about the concept of a woman being an innkeeper in that day and that culture, when women generally did not hold down jobs but were required by their culture to take a husband. Even if she is an innkeeper, it might be by definition a tad shady to have strange men coming to stay overnight at the house of an unmarried woman.
Let's face it, though; Rahab was almost certainly an outright prostitute of some sort, but let's consider a few things in relation to that. First of all, the Bible does not say that the two spies went to her for her services as a prostitute. If the reader would like to imagine they did, I suppose I can't say that the Bible says they did not, either, so speculate away. Secondly, note that whatever it is she does for a living, it's not a secret; even the king seems to know about her.
It's this second point that leads to the third and perhaps most important point. What sort of city was Jericho? They had a prostitute who lived in a nice house attached to the city wall, everyone knew she was there and didn't care. In the end of our story, she comes to be rescued from the city because of her righteousness. Think about it for a minute. Yes, she was a prostitute. Yes, she was a liar. Yet still, she was apparently the most righteous person in that whole city. What does that say about Jericho?
What drives a woman to become a prostitute? Sure, there may be a number of reasons, but don't most of them boil down to the fact that when a society does not take care of its people, then those people will be forced to resort to immoral means of making a living? In my opinion, the real victim of the crime of prostitution is surely the prostitute. It may be that Rahab was sick of the society that had brought her to the state she was in, and that is why she was so very willing to cast her lot in with the Israelites. That's speculation on my part, but it doesn't seem too far out there to me.
What is not speculation is that at least in part, Rahab gives her reasons for protecting the spies. Verifying what I said earlier, back around, oh... here. Rahab informs the spies that everyone in the land of Canaan knows what happened in Egypt (and various other places) and that the God of Israel doesn't mess around. She knows that if Israel is headed this way, Jericho is about to be wiped off the map, and she needs to pick sides now.
This actually makes the moral value of her lies more ambiguous than some other ones so-called "righteous" people got away with, and it makes me want to make a slight backpedal on what I said about the issue in Exodus 2. Sure, Rahab is lying because she knows that it's the easiest way to save the lives of the Israeli spies, but she's also doing it to save her own skin. Furthermore, it is most likely in no small part due to her lies that her family becomes the only one saved from Jericho. I wonder whether turning in the spies might have resulted in more people being saved from the destruction of Jericho? (I've heard at least one pastor suggest that "spies" is not the best term for these men, but perhaps they were sent in to give a last warning to repentance.) I think this edges a bit further into the gray in the matter of lying to protect life.
Rahab helps the spies sneak out of the city, and they return to Joshua with the good news that all the people of Canaan are terrified of them.