The Torah does not say "Thou Shalt Not Lie". The language that Torah uses is "m'Dvar Sheker Tirchak" (Distance yourself from a falsehood), Exodus 23:7. It is quite a controversial verse as the wording seems to be unclear and the authorities argue as to what it really means. For the sentence to be a clear and concise statement it should have read "Al Tishaker" (or Lo Leshaker) which means "Do Not Lie" and which follows the syntax of the vast majority of the other Negative Commandments in the Torah. But, due to its slightly ambiguous structure some authorities are of the opinion that God is sending us a message that the prohibition against lying is much more stringent than a regular Negative Commandment which is reflected in the command "Distance yourself", i.e. do not even allow yourself to be found in the vicinity of untruth. Others understand that the wording is coming to teach us that there might be limited occasions when it is permissible to lie and, subsequently, it was not possible for God to command "Do Not Lie".
According to those authorities who permit lying it is only for making (or keeping) peace. That means that it would be permissible to lie about a certain action if not lying would cause someone else pain or anguish.