It seems to me that Scripture rules out lying. See
Leviticus 19:11 and
Ephesians 4:25.
The case of Rahab is often brought up (e.g. by some commentators on this blog) as a case in which God approves of lying. The case is described in Joshua 2:
1 Then Joshua son of Nun secretly sent two spies from Shittim. "Go, look over the land," he said, "especially Jericho." So they went and entered the house of a prostitute named Rahab and stayed there.
2 The king of Jericho was told, "Look! Some of the Israelites have come here tonight to spy out the land." 3 So the king of Jericho sent this message to Rahab: "Bring out the men who came to you and entered your house, because they have come to spy out the whole land."
4 But the woman had taken the two men and hidden them. She said, "Yes, the men came to me, but I did not know where they had come from. 5 At dusk, when it was time to close the city gate, the men left. I don't know which way they went. Go after them quickly. You may catch up with them." 6 (But she had taken them up to the roof and hidden them under the stalks of flax she had laid out on the roof.) 7 So the men set out in pursuit of the spies on the road that leads to the fords of the Jordan, and as soon as the pursuers had gone out, the gate was shut.
The first thing to note is that it isn't absolutely clear that Rahab does lie here. How do we know that she did know from where (specifically) the men had come? How do we know that the men didn't leave (leave what?) at dusk, returning to Rahab's later? How do we know that Rahab did know which way they went from wherever it was to her house? And how do we know that Rahab knew that 'you
may catch up with them' was false? (Admittedly, the ESV has 'will' for 'may' here.) Anyway, I shall proceed on the plausible but unproven assumption that Rahab was lying: even if her words weren't strictly false she seems to have been out to deceive.
The next thing to note is that there is, of course, no commendation of Rahab by God in Joshua 2. But
James 2: 25 comes in here. Here is my literal translation from the Greek:
25 But in the same way was not even Rahab the prostitute justified by works, having received the messengers and sent them out in a different direction?
Although this is a question, it clearly expects the answer 'yes', and so may be treated as an affirmation. But note that James 2: 25 doesn't say that Rahab the prostitute was considered righteous because she lied. The Greek says she was considered righteous by her 'works'. The inference is (though this is not explicitly said) that her works were the things mentioned: receiving the messengers and sending them out in a different direction? Who were these 'messengers'? The spies or their pursuers?
In the first case there is no hint of a problem. The word 'received', which can also mean 'welcomed', fits this case better. Also compare
Hebrews 11: 31, which I translate literally as follows:
By faith Rahab the prostitute did not perish with those that had disobeyed, having received the spies with peace.
Here the word 'received' in Greek is closely connected with the word for 'received' in James 2: 25, and here there is no doubt that it is the spies about whom we are talking. (Incidentally, some commentators think that 'received' is a euphemism hinting at Rahab doing her job with the Israelites. I doubt that this is true, but if it is it does fit more with the spies than with the pursuers.)
In the second case Rahab is still not commended for lying, but rather for sending the pursuers out in another direction (i.e. as opposed to welcoming them into the house to look for the spies). Sending someone in another direction is not lying. It seems true that Rahab achieved this end by a lie, but it is this end, not her means, that is commended here -- if this interpretation is correct.
The basic point that James is making is, of course, that Rahab didn't just sit around believing, but actually acted on her beliefs . He is not making the point that everything she did was good. I think that Rahab was wrong to lie, but right to try to save the spies, and that this is why she is commended.
One final thought: some may say that one cannot be a spy without lying. But the spies are not commended by God for what they did. In any case, they may be more like SAS-style secret agents trying to move about unseen (unsuccessfully in this case) than like MI6-style spies with false identities etc.