For some energy investors, last week was a great one after a quartet of stocks in the sector rallied sharply on some bullish news. That likely had those on the outside looking in wondering whether they missed the boat, or if there might be more upside ahead. Here's a closer look at what fueled this week's big move in those energy stocks and whether they have anything left in the tank.

Trump rumors fueled bullish buying in these refining stocks

Shares of refining companies Andeavor (NYSE:ANDV) and CVR Refining (NYSE:CVRR) took off this week, rallying about 11% each. Fueling those moves was increasing speculation that the White House will make changes to the U.S. Renewable Fuel Standards program, which is a crucial issue impacting smaller refiners. That program requires refiners to mix biofuels like corn-based ethanol into their fuel to help farmers and reduce the country's oil imports. However, it has become increasingly costly for smaller refiners like Andeavor and CVR Refining because the price of purchasing tradable blending credits, known as RINs, has skyrocketed in recent years.

Gas flaring off an offshore oil platform with the sun in the background.

Image source: Getty Images.

The Trump administration has been working with both refiners and corn producers on a solution that addresses this issue and has another high-level meeting scheduled for next week. If the two sides can agree on a solution, it could dramatically reduce costs for companies like CVR Refining and Andeavor. CVR Refining, for example, believes a policy change could save it $50 million this year and cut its compliance costs down to $200 million. That said, there are no guarantees that the two sides will reach an agreement, which means last week's big gains could go up in smoke.

Finally turning around, but still a long way to go

Two other big movers this week were specialty petroleum products maker Calumet Specialty Products Partners (NASDAQ:CLMT) and Canadian oil producer Baytex Energy (NYSE:BTE), which surged 15% and nearly 20%, respectively, this week after reporting fourth-quarter results. In Calumet Specialty's case, its adjusted EBITDA more than tripled to $60.1 million. Because of that, and some asset sales, the company has significantly improved its credit profile in the past year, reducing its leverage ratio from a gravely concerning 13 times debt-to-adjusted EBITDA in 2016 to less than five times this year. That led the company's CEO Tim Go to proclaim that he was "pleased to report that we have successfully turned the corner." While Calumet is heading in the right direction, it remains a riskier investment option.

Meanwhile, Baytex Energy leaped after reporting a 37% year-over-year increase in cash flow as production came in at the high end of its guidance range thanks to strong performance from its assets in the Eagle Ford Shale of Texas. The company was also able to reduce debt last year as capital spending came in below cash flow. That said, while Baytex entered 2018 on a more solid footing, the company won't generate enough cash flow this year to spend what's needed to increase production. Because of that issue, and the company's still-elevated debt levels, Baytex remains well behind stronger peers, which are growing fast and increasing the amount of money they plan to send back to investors this year.

Caution: Too hot to handle

While some good news ignited big rallies in these energy stocks this week, those gains might not last. Andeavor and CVR Energy, for example, could fall sharply if the Trump administration can't work out a deal to fix their biofuel blending cost issues. Meanwhile, an unexpected change in oil prices could singe Baytex and Calumet because their finances are still a bit too tight, increasing the risk that they might stumble if market conditions shift. Because of that, investors shouldn't chase after these energy stocks. Instead, they might want to consider buying these top energy stocks instead.

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