Valero Energy (NYSE: VLO) reported earnings on July 23. Here are the numbers you need to know.

The 10-second takeaway
For the quarter ended June 30 (Q2), Valero Energy beat expectations on revenues and beat expectations on earnings per share.

Compared to the prior-year quarter, revenue contracted slightly. Non-GAAP earnings per share dropped significantly. GAAP earnings per share dropped significantly.

Margins contracted across the board.

Revenue details
Valero Energy logged revenue of $34.03 billion. The five analysts polled by S&P Capital IQ wanted to see a top line of $30.18 billion on the same basis. GAAP reported sales were the same as the prior-year quarter's.

Source: S&P Capital IQ. Quarterly periods. Dollar amounts in millions. Non-GAAP figures may vary to maintain comparability with estimates.

EPS details
EPS came in at $0.96. The 14 earnings estimates compiled by S&P Capital IQ anticipated $0.94 per share. Non-GAAP EPS of $0.96 for Q2 were 36% lower than the prior-year quarter's $1.50 per share. GAAP EPS of $0.85 for Q2 were 43% lower than the prior-year quarter's $1.50 per share.

Source: S&P Capital IQ. Quarterly periods. Non-GAAP figures may vary to maintain comparability with estimates.

Margin details
For the quarter, gross margin was 4.2%, 140 basis points worse than the prior-year quarter. Operating margin was 2.4%, 160 basis points worse than the prior-year quarter. Net margin was 1.4%, 100 basis points worse than the prior-year quarter. (Margins calculated in GAAP terms.)

Looking ahead
Next quarter's average estimate for revenue is $32.95 billion. On the bottom line, the average EPS estimate is $1.38.

Next year's average estimate for revenue is $123.04 billion. The average EPS estimate is $4.42.

Investor sentiment
The stock has a four-star rating (out of five) at Motley Fool CAPS, with 4,365 members out of 4,557 rating the stock outperform, and 192 members rating it underperform. Among 974 CAPS All-Star picks (recommendations by the highest-ranked CAPS members), 944 give Valero Energy a green thumbs-up, and 30 give it a red thumbs-down.

Of Wall Street recommendations tracked by S&P Capital IQ, the average opinion on Valero Energy is outperform, with an average price target of $46.40.

Is Valero Energy the right energy stock for you? Read about a handful of timely, profit-producing plays on expensive crude in "3 Stocks for $100 Oil." Click here for instant access to this free report.