Valero Energy (NYSE: VLO) reported earnings on July 31. 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 expanded and GAAP earnings per share grew significantly.

Gross margins dropped, operating margins contracted, and net margins were steady.

Revenue details
Valero Energy chalked up revenue of $34.66 billion. The five analysts polled by S&P Capital IQ expected revenue of $32.99 billion on the same basis. GAAP reported sales were 12% higher than the prior-year quarter's $31.07 billion.

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 $1.50. The 16 earnings estimates compiled by S&P Capital IQ predicted $1.44 per share. GAAP EPS of $1.50 for Q2 were 15% higher than the prior-year quarter's $1.30 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 5.5%, 40 basis points worse than the prior-year quarter. Operating margin was 3.9%, 30 basis points worse than the prior-year quarter. Net margin was 2.4%, about the same as the prior-year quarter.

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

Next year's average estimate for revenue is $123.56 billion. The average EPS estimate is $3.83.

Investor sentiment
The stock has a five-star rating (out of five) at Motley Fool CAPS, with 4,373 members rating the stock outperform and 185 members rating it underperform. Among 1,061 CAPS All-Star picks (recommendations by the highest-ranked CAPS members), 1,029 give Valero Energy a green thumbs-up, and 32 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 $29.44.

Can your retirement portfolio provide you with enough income to last? You'll need more than Valero Energy. Learn about crafting a smarter retirement plan in "The Shocking Can't-Miss Truth About Your Retirement." Click here for instant access to this free report.