As a group, refining stocks easily beat analysts' estimates this quarter. Valero Energy Corporation's (VLO -1.35%) earnings were 21% higher than analysts were expecting, while Phillips 66 (PSX -3.91%) bested estimates by 24%. Those pale in comparison to Marathon Petroleum Corp. (MPC -1.26%), which blew past estimates by 83%. What's interesting is that all three companies took a different path to success on the quarter. However, the path that produced the most surprising success was Valero.

Corn fed profits at Valero
Valero's ethanol segment really fueled its earnings on the quarter. The segment produced operating income of $269 million on the quarter. That's a major jump from the $12 million the segment earned in the fourth quarter of 2012. Valero enjoyed significantly higher margins thanks to a decrease in corn prices and low industry ethanol volumes. The company's earnings in the segment were further enhanced by the fact that it produced record ethanol volumes of 3.6 million gallons per day.

Valero has enjoyed a major reversal in the segment over the past year. Full year operating earnings came in at $491 million for the ethanol segment, which is a nice turnaround for a segment that lost $47 million in 2012. Overall, the company saw record-high quarterly and annual operating income from that segment, which really helped to boost its bottom line.

Peers look elsewhere for profits
Earnings at Phillips 66 and Marathon Petroleum, on the other hand, might have bested estimates, but both were down over the previous year. Both companies struggled with higher costs, which put a dent in refining margins. These same costs were also felt by Valero, however, thanks to the surge in ethanol profits, the company wasn't as affected by these margin pressures.

As a whole, refining margins weren't as bad as they would have been if refiners hadn't focused on using more domestically produced crude oil. Phillips 66, for example, increased its usage of advantage crude oil from 67% to 94% over the past year. That helped it overcome margin pressures throughout most of its refining portfolio.

The same can be said for Marathon Petroleum, which used more domestically produced oil. That really fueled earnings on the quarter and enabled it to trounce earnings estimates. However, the company's earnings still fell by 17% over the previous year.

Despite the fact that cheaper domestic crude oil prices are enhancing refining earnings, both companies are focusing on growing other revenue streams in an effort to stabilize profits. Phillips 66 is investing 70% of its 2014 capital budget to capture midstream and chemicals growth opportunities. Meanwhile, Marathon Petroleum is investing to grow its midstream business as well as its Speedway convenience store brand.

Investor takeaway
While cheap domestic crude oil helped refiners this quarter, margins are still being squeezed. Because of this, we're seeing the group look outside of oil refining for additional profits. For at least this quarter Valero has emerged as the winner among its peers thanks to the corn-fueled profits of its ethanol business. However, if the past is any indication, those profits might dry up if corn prices rise or the industry becomes over-supplied.