In questioning whether it is ever right to lie, there are usually two distinct questions:
- What exactly is a lie? Is it necessary to always tell the whole truth, or can you withhold the truth if needed?
- Is it always wrong to lie, or is it permissible to lie to prevent a greater evil? The classically debated case of this would be when a Nazi soldier comes to your door and asks if you are hiding any Jews. If you say "Yes", or refuse to answer, then the Jews will be killed. Is this sufficient reason to lie?
This article from Catholic Answers provides a great over view on the subject. I will do no more than summarize, and pull out some quotes. If you want a very quick summary, then it is: "there is no universal agreement on the matter; Catholic theologians disagree, and there is no definitive pronouncement from the church"
The first thing to be said is that the biblical text of the eighth commandment is strictly about telling untruths in a legal setting. There is good reason that even modern translations render it as "Do not bear false witness", rather than "Do not lie". The original quote is not about lying under everyday circumstances, but about lying in the courts. Nevertheless, most Christians would extend the prohibition to telling untruths in normal settings by 'moral reasoning' even if there isn't a clear biblical prohibition (though there are presumably some Bible-only Christians who would not).
Early Catholic theologians, e.g. Augustine and Aquinas, were mostly against the "necessary lie", and come down on the side of telling the truth in all circumstances. They took the view that God is capable of protecting those who might be harmed through your truth-telling - in our example example the Jews hidden in your house. However they did also agree that it was necessary to 'prudently protect the truth' - i.e. to avoid answering the question if at all possible.
More modern theologians have moved away from this view, and would argue for the 'necessary lie'. Most modern Catholics would also argue that it is right to tell a lie in the Nazi soldier example given above, even if they cannot articulate a philosophical reason why. The evil that results from the truth would be perhaps greater than the evil of the lie. One approach that was popular early in the century was the 'mental reservation', in which the speaker mentally interprets their answer to mean something different from what the answer might take it as. Thus the person would answer the Nazi soldier "No", and interprets their own answer to mean "There are no Jews here which you should be arresting and killing". (It goes without saying, and is universally agreed, that lying for your own personal gain, or except to prevent an evil, is always wrong, whatever 'mental reservations' you might employ.)
Another approach from some theologians is to replace the current definition of a lie from the Catholic Catechism, which is
"To lie is to speak or act against the truth in order to lead someone into error" (CCC 2482, 2483)
with a slight variant:
"To lie is to speak or act against the truth in order to lead into error someone who has the right to know the truth."