Rather than answer the question straightforwardly, which could be misleading, I want to start by pointing out that the answer one gives will depend upon which normative ethical framework/theory they adopt. A normative theory is one that gives an answer to the question "What makes a right (or wrong) action right (or wrong)?" Ideally, the normative theory will have its own independent arguments for what it should be adopted, and then it will tell us whether and when lying is permissible or not.
For instance, a deontologist about normative ethics will focus on the nature of the action itself in determining what it is that makes an action right/wrong. In other words, some actions are right/wrong in themselves, or by their very nature. Murder, exploitation, and torture are examples that might come to mind of inherently wrong actions. Does lying fit this mold of an inherently wrong action (i.e. one that is wrong in and of itself)? Kant is famously understood as arguing that lying is inherently (always and everywhere) wrong. His explanation was that normative ethics--rightness and wrongness of actions--is grounded in reason, such that any moral claim or principle must pass certain tests of reason in order to be considered correct. One such test was called the 'categorical imperative', which states that for any true moral claim or principle, we must be able to will that it be implemented by anyone as a universal rule. A simplified way to think of it is this: Ask yourself, what if everyone took lying to be permissible? Kant thought that this would be self-contradictory since if everyone thought lying was permissible, the whole institution of truth would be undermined. Hence, lying would be too. Thus, you cannot rationally will that "lying is permissible" be a universal law (since, as we showed, it is self-undermining). Thus, lying is wrong--in and of itself.
Some deontologists don't like the result that lying is ALWAYS wrong (consider someone hiding Jewish runaways in their attic during WWII, and German soldiers come to the door...). WD Ross is one such deontologist. His response was to keep the claim that lying is inherently wrong, but that this does not mean that it is never permissible to lie. Sounds odd, I know. However, his explanation was that there was a difference between "pro tanto" or "prima facie" (there is a difference between those technically, but we can think of them as the same for now) rights and wrongs, and "all things considered" rights and wrongs. While actions had rightness or wrongness as a part of their natures (he is a deontologist), he recognized that sometimes rightness and wrongness conflict in a single action. For instance, if you have to break a promise in order to stop and help someone, or lie in order to avoid significant suffering to you or others. Ross thought that after you "weighed" all the rightness and wrongness of the various aspects of your action (e.g. its wrong to lie, but good to alleviate suffering, etc.), you would come up with an all things considered judgment or answer to the action as a whole (i.e. after all morally relevant things were considered). So, lying is wrong in and of itself in a "pro tanto" sense, but not necessarily in an "all things considered" sense, since some situations (Nazis at the door) might warrant doing something pro tanto wrong in order to bring about some greater, all things considered, right/good action/result. Importantly, when the goods outweigh the bads, this does not make lying itself right. It makes lying all things considered permissible, while still being pro tanto wrong. This, for Ross, even explains "moral residue" left over (e.g. guilt, etc.).
Now, if one is a consequentialist (rather than a deontologist) about normative theory, then they think that what makes an action right or wrong is the consequences. There are different forms, but the most famous is the utilitarian version of consequentialism. Utilitarians hold that the right action is the one with the best consequences (like all consequentialists), and "best consequences" should be understood in terms of well-being, happiness, or "utility". In other words, an action is right if and only if it produces the most well-being or happiness compared to the alternatives. There are numerous details that remain, but that's the idea. Some alternatives are understanding "best consequences" in terms of desire-satisfaction or in terms of an objective list of goods (e.g. producing the most love, truth, friendship, dignity, respect, happiness, etc.). So, for the question of whether lying is ever permissible, a consequentialist is going to say yes. The reason is that it is quite conceivable to think of a situation in which lying produces the best outcome compared to the alternatives (recall the Nazis at the door). You might think, well what happens if waaaay down the road something bad happens (butterfly effect stuff...). Well, that's possible. However, the consequentialist is just going to say that all we need is some possible situation in which lying IN FACT produces the best outcome, to the extent or duration which is ACTUALLY morally relevant. Exactly when we stop counting consequences or, if we don't, exactly how we could know enough about them to determine an answer is another (epistemic) question. Their concern is what is in fact true about the world in terms of the relevant consequences, and not whether we can find them out. If it is in fact true that option A (involving lying) would produce the best consequences, however that is calculated, then lying is permissible (in that scenario).
A third alternative is virtue theory. This normative framework is a little different, and less discussed than the other two. It focuses not on actions themselves, nor on consequences, but on the character of the individual performing the action. In short, an action is right or wrong based on whether or not it is something that would be performed by a virtuous or vicious person. Right actions are those that virtuous persons would perform in those exact circumstances. Wrong ones are those a vicious person would perform. Now, the question is what does it mean to be virtuous or vicious. There are numerous answers to this question. Aristotle famously gave an account of this in terms of developing dispositions that tend towards the mean, and that express our rational natures. But for the virtue theorist, the main point for your question would be to ask whether or not a virtuous person would ever lie. Would it be consistent with a virtuous character, or contribute to a virtuous character, to lie in any possible scenario? It seems so. Because there is a focus on the mean between extremes, developing dispositions that respond to the relevant factors in the situation, and so forth, it seems reasonable that virtue will involve some leeway with respect to any virtue, including honesty. In other words, if honesty is a virtue, it doesn't mean that a virtuous person tells 100% truth 100% of the time. It means the virtuous person knows exactly when to provide honesty and to provide dishonesty, according to the circumstances.