It's been difficult to find value in an energy sector that has suffered amid a global glut that has pressured the industry's revenue and margins. But owing to a solid refining business, Marathon Petroleum (MPC - Get Report) , whose shares are up 7.5% in 2015 and 12.2% in 12 months, has been an exception. And ahead of the company's third-quarter earnings results Thursday, investors should be careful. Chasing Marathon stock higher after its relative outperformance may not make sense.

For the quarter that ended September, the average analyst earning-per-share estimate calls for $1.80 a share on revenue of $20.40 billion, compared to the year-ago quarter, when the company earned $1.18 a share on revenue of $25.48 billion. For the full year, ending in December, earnings are projected to climb 31% year over year to $5.92 a share, while revenue of $73.96 billion would mark a year-over-year decline of 24%.

True, oil pries have begun to rally. Industry experts appear more optimistic that the energy industry has already seen the worst. But with the Energy Select Sector SPDR Fund (XLE - Get Report) soaring 10% in the span of a month, it seems more prudent to look for stocks that have yet to participate in the rally.

In the case of Marathon, it would seem the stock has benefited from the company's refining business, which can be considered safe amid periods of weak oil prices. This because refiners make money off the spread of oil prices -- the difference in what it cost to produce oil products, also known as the "rack." This is the wholesale price of what refiners sell out of the refinery.

But Marathon missed its second-quarter earnings estimates, despite the decline in crude prices -- which meant the company should have benefited. What's more, Marathon's refining margin fell 7% year over year to $14.84 per barrel from $16.02 per barrel in the year-ago quarter. This culminated in an operating earnings decline of 4.3% year over year.

For some context, rival refiner Valero Energy (VLO - Get Report) topped Wall Street estimates, posting a 40% year-over-year jump in refining margins, climbing from $9.84 per barrel last year to $13.71 in its comparable quarter. In other words, Marathon's refining business hasn't shown the strength investors had hoped to see.

Now that oil prices have begun to rally, Marathon is likely to lose the competitive edge that drove its stock higher in the first half of the year. So buying Marathon stock ahead of Thursday's results or expecting an improved refining business on the basis of higher oil prices doesn't make sense.

Investors would be better served taking profits now and waiting for the company to issue its business outlook for the rest of the year and beyond.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.