Image source: Getty Images.

What happened

Shares of offshore oil producer W&T Offshore (NYSE:WTI) gained a whopping 31% in December. While the company released no significant news that would shift the trajectory of the business, the changes in oil prices did all the talking for this struggling company.

So what

Let's be clear when we talk about W&T Offshore: This is a company that less than six months ago was on the cusp of bankruptcy. It had to do a deal with its creditors to exchange about $750 million in debt for shares as well as $300 million in paid-in-kind notes (bonds that pay interest in additional bonds instead of cash). The hope with this move was that higher prices will help improve profitability and allow the company to pay off debts later down the road. 

This month, it did get some reprieve as oil prices started to rise. OPEC's announcement to cut production was the needed boost of confidence to many on Wall Street that today's oil prices -- currently in the $55-$60-a-barrel range -- are, at a minimum, here to stay. As a result, investors have been a little more confident that W&T will sort out its balance sheet issues.

WTI Chart

WTI data by YCharts.

Now what

There are two ways to look at this. For those with a more optimistic outlook for oil prices in the coming years, there is the fact that this stock price gain is only a small blip on the decade of declines that shareholders have experienced. So perhaps there is more room for this company to run with higher oil prices.

WTI Chart

WTI data by YCharts.

On the other side of the coin, W&T Offshore is still very much a financially distressed company that is wholly dependent on a significant rise in oil prices to fund its current operations and clean up its balance sheet. Even if it is able to pull this off, it is going to take time before shareholders see the benefits of this in the form of earnings or any return on capital.

There are a lot of oil and gas companies trading at low stock prices that have much better-looking financial statements, so it's hard to justify making an investment in W&T Offshore today. 

Tyler Crowe has no position in any stocks mentioned. You can follow him at Fool.com or on Twitter @TylerCroweFool.

The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.