After months of pain, it’s finally good to be a Baytex Energy Corp. (TSX:BTE)(NYSE:BTE) shareholder.

Shares of the beleaguered energy producer surged in early trading on Tuesday, increasing more than 11% on a couple pieces of news. The price of Brent crude oil went above $44 a barrel as investors have become optimistic that both Russia and Saudi Arabia have agreed to freeze output ahead of an important producers’ meeting that’s scheduled to take place on Sunday.

The other thing affecting Baytex is a recent upgrade on the stock; one analyst predicted the company’s shares could hit US$5.50 on the New York Stock Exchange. Before the upgrade, shares were trading hands at US$4.30.

Baytex has been active on a corporate level as well. It recently announced a deal relaxing its covenants with debt holders, which will give it the flexibility to make the kind of moves needed to avoid technically defaulting on its debt. Remember, Baytex has no meaningful debt maturities until 2021.

It also made the choice to shut down approximately 7,500 barrels of heavy oil production in northern Alberta because the economics no longer made sense. These projects had a breakeven price of approximately $47 per barrel, which means they don’t make much sense today. The good news is that once crude recovers, this production can pretty easily be brought back online.

The company is in pure cash-conservation mode. It announced that it only plans to spend between $225 and $265 million on capital expenditures this year. This compares to $523 million spent in 2015 and $790 million in 2014. The goal is to only spend enough so funds flow cover capital expenditures. It’s a necessary move for a company that simply cannot afford to take on more debt.

These days, most of Baytex’s production is coming from the Eagle Ford formation in Texas, an area known for its low cost of production. With a breakeven cost of $32, it’s little wonder why 95% of the company’s capital budget is being spent in that region. This is good news; it means that the company’s 2016 production won’t be that much lower than 2015.

In short, Baytex is doing exactly what you’d expect an oil company to do in today’s market. This is good news for the future. All the company really needs now is for crude to recover.

Potential upside

After yesterday’s big spike, many investors are probably thinking they’ve missed out on the Baytex rally.

Nothing could be further from the truth.

Shares of the company currently trade for $6.20 each on the Toronto Stock Exchange, increasing more than 200% compared to recent lows. Back in late January, shares of Baytex could be had for less than $2 each because investors were convinced that sub-$30 crude was here to stay.

But this price movement is only the beginning, if history is any guide. Back in late 2014 to early 2015, crude rallied from $45 per barrel to over $60. Baytex shares rallied at the same time, increasing from a low of $15 each to a high of $24. Even if we assume a reasonable target price is only $15 per share in a world where oil has recovered to $60 per barrel, that still represents more than 100% upside from today’s levels.

And remember, Baytex paid a generous dividend when crude was higher. That could return as well.

This kind of return isn’t even close to guaranteed, of course. It really boils down to a levered play on the price of crude. At $40 per barrel, Baytex is marginally free cash flow positive. At $60 per barrel, it’ll generate a healthy amount of free cash flow, since just about all of the gain in crude flows to the bottom line.

Baytex isn’t out of the woods yet. But if crude keeps recovering, investors are going to be kicking themselves if they don’t buy this highly levered company today.

Two more energy plays you won't want to miss!

Baytex isn't the only Canadian energy stock with all sorts of potential upside.

Check out our special FREE report "2 Canadian Energy Stocks on the Cusp of a Powerful Long-Term Trend". In this report, you'll find that Canada is rich in other energy sources that are poised to take off. Click here now to get the full story.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Nelson Smith has no position in any stocks mentioned.