Torture, as such, is a flagrant violation of international law. It has been outlawed by numerous treaties, conventions, and agreements to which the United States has been party. So I would argue that it is, prima facie, never justified. That said, defining precisely what torture is has been trickier than one might imagine, particularly when it comes to psychological torture and some of the so-called "enhanced interrogation" techniques that were in the news not so long ago. The other issue, which post 2 brings up, is the issue of whether torture is an effective means of extracting information. The study I link to below cites much evidence that torture is an ineffective means of getting accurate intelligence, or at least that much of the information gained under torture turns out to be false. When weighed against the costs of being a nation that consciously chooses to pursue such policies, I would argue that torture is not justified under any circumstances, including the so-called "ticking bomb" scenario.
Basically, some people argue that if there is an eminent threat and very little time to stop it, we have the right to torture. Unfortunately, you actually have less time to act if the threat is near and torture does not always give you the most reliable information, so this hypothesis has its flaws.
To discuss this, we would first need to know if torture (or "enhanced interrogation techniqyues") actually make it more likely that the prisoner will give up accurate information. In the ticking time bomb hypothesis (whether in extreme circumstances or not), we would want accurate information, not just whatever the person says to make the pain stop. There seems to be disagreement among professionals as to the effectiveness of torture.
In general, I'm inclined to say that torture can be used in extreme circumstances. But I'd want to be really sure it works, and I'm not.