This is a misconception of two interrelated aspects of Rand’s ethics here: agent-relativity and contextuality. What does this mean?
The approach of traditional morality is that values are either intrinsic or subjective. Either it is good to do one particular thing because it is good in itself (“good” as an absolute attribute of some thing or action or choice), or else there is no absolute good, everything is just subjective. If Rand says lying is immoral, then it must be intrinsically wrong to do, wrong it itself, apart from its effects on the actors involved. But the agent-relative approach Rand takes is that rightness or wrongness is an aspect of reality in relation to man. The goal of values are to advance our lives, so a value considered apart from its relation to the moral agent fails to fulfill that function. We can’t evaluate something as being good or bad apart from its full impact on all facets of that person’s long-range well-being.
So this brings up the aspect of context. Nothing is right or wrong in a vacuum, because there is no such thing as reality in a vacuum. There is always context, meaning the particulars of a specific situation, a background. Things are interrelated with this background, and so the background conditions our understanding of the facts involved. So to ask “is X right or wrong” is to ask “in the context of this particular situation, is it good or bad for me to do X?” The reference to the surroundings of the situation is necessary to preserve context, and the “for me” is necessary to preserve its effects on the acting moral agent. In this way, what the good is dependent upon its effects on you (agent-relative), can differ from person to person, situation to situation (contextual), and within those constraints can still be absolute and mind-independent (objective.)
So when we read the section in Atlas Shrugged or The Virtue of Selfishness where Rand is talking about honesty and considering it as a virtue, she is in other words considering it as a general strategy for long-term success in life, not as some kind of out of context dictum or commandment. The specific application of each of the generalized goods and virtues is unique to each person, and thus it’s up to each individual to make decisions based on the unique context of knowledge he has in the varied particular circumstances and situations oh his life. Fooling some person in that instance can save your life, so would definitely be moral. The demands of honesty are for practical, selfish reasons, they don’t apply in absolutely all imaginable circumstances regardless of their consequences. So in emergencies, we have different context. The point is that in general, faking reality and trying to deceive people is not a good strategy. There is the above section of Peikoff’s OPAR where this is explained. There is also Smith’s Ayn Rand’s Normative Ethics chapter 4, a section on “Special Cases” and a subsection on “Responding to Force” p. 94.
So you’re right in suspecting that Rand would say that it wouldn’t make sense to be morally required to tell the truth to person threatening you with physical force, and actually has written on that topic. I know there was some incident with some American POWs who were punished by the Army after being forced to denounce the US for some North Korean propaganda films, which Rand wrote about (I’m just too lazy to look anything up atm.)
This is a great question and yours is, by far, the best answer.
That said, I think it points to a bigger issue that ObjectivistMathematician glossed over when he replied that:
Second, yes, it is absolutely moral to lie in emergencies. When you’re in an emergency, your goal is to get out of the emergency. When someone is using force against you, your moral principles, value-judgments, and reason in general don’t really work as they do in normal situations, and you just have to escape the emergency. Therefore, you should lie to get out of emergencies if necessary. Furthermore, lying is not always dishonest, even when you’re not in an emergency. On pages 275-276 of OPAR, Leonard Peikoff explains that if your honesty becomes a tool for people to meet their immoral ends, then you should absolutely lie. These situations include when someone might kill you (as per your example), or when someone is snooping around and trying to get personal information from you, etc.
If the circumstances in which someone is using our honesty to meet their immoral ends constitutes an emergency then most of life constitutes an emergency. Just think about all the government forms you must fill out to facilitate taxation, etc.
And in most of these situations, lying is not going to be the best strategy. If the question is can lying ever be moral, I think we can invent situations in which it is. But these tend to be very exceptional situations.
(As an aside, Tara Smith took the position that lying was always wrong on the grounds that any denial of reality, even a feigned one under duress, was toxic.)
But this leads to a more general question: what is the moral response to an immoral world? To what extent is tolerance the appropriate answer?