Valero (VLO -0.80%) will release its quarterly report next Tuesday, and the refiner is at a crossroads right now. Even though the prices for refined products like gasoline have remained high, rising prices for crude -- especially once-cheap domestic West Texas Intermediate -- have squeezed margins, posing a threat to Valero earnings going forward.

Times have good at Valero and throughout the refining industry for a long time, as the boom in energy production left the company with cheap sources of crude inputs from which to produce high-margin gasoline, diesel, and other fuels at big markups for the world market. But such conditions tend to run in cycles, and Valero might have to face an inevitable downturn in the near future. Let's take an early look at what's been happening with Valero over the past quarter and what we're likely to see in its quarterly report.

Stats on Valero

Analyst EPS Estimate

$0.92

Change From Year-Ago EPS

(39%)

Revenue Estimate

$30.18 billion

Change From Year-Ago Revenue

(12.9%)

Earnings Beats in Past 4 Quarters

4

Source: Yahoo! Finance.

Will Valero earnings contract for a long time?
Analysts have severely cut their views in recent months on Valero earnings, with reductions of more than 40% in their June-quarter estimates and a $1-per-share drop for their full-year 2013 consensus. The stock has responded as you might expect, declining about 5% since mid-April and falling even further from its highs for the year.

For years, Valero and fellow refiners have benefited from the availability of cheap U.S. crude from unconventional production methods. Plentiful domestic supplies sent spreads between West Texas Intermediate and global Brent prices as high as $15 to $20. Valero wasn't the biggest beneficiary of that trend, as its refining throughput margin of around $10.59 in the first quarter paled in comparison with Phillips 66's (PSX -3.71%) $14 figure and HollyFrontier's (HFC) even more impressive $23-plus gross margin. But players throughout the industry have benefited from those trends while they lasted.

Unfortunately, now, the tables are turning on Valero. Oil prices are rising, but the consequent gains for gasoline simply haven't been there. Although some of the factors pushing oil prices higher are geopolitical and therefore could subside if conditions improve, the arbitrage-related moves that producers and refiners have used are having the usual effect of cutting Brent-WTI spreads and creating a new equilibrium for prices.

Still, Valero thinks domestic crude is still a smart investment, having paid $750 million recently for railcars to help it transport crude oil by rail to its refineries in Louisiana and California. With Phillips 66 having similar arrangements to bring Bakken crude to its East Coast refineries, any boost in production that results in lower prices could bring additional benefits to the industry.

In the Valero earnings report, look to see what impact the spinoff of its CST Brands (CST) gas-station and convenience-store business will have on Valero's continuing operations figures going forward. By separating marketing from refining, Valero will be more of a pure-play refiner and be fully exposed to the ups and downs of the industry.

Click here to add Valero to My Watchlist, which can find all of our Foolish analysis on it and all your other stocks.