It's a good time to be an oil refiner right now. Advantageous pricing spreads have widened margins and greatly boosted profitability this year. In turn, refiners like Marathon Petroleum Corporation (MPC -3.67%) are putting up excellent numbers, and its stock price is rallying as you'd expect.

But operating conditions aren't always this favorable. In the oil refining industry, the environment can change quickly. Last year, refining margins were razor thin, as spreads between West Texas Intermediate and Brent crude narrowed. This caused profits to fall off a cliff in 2013, which is one of the reasons why growth rates look so good this year. Oil refiners are benefiting from extremely easy comparison periods.

That being said, if business conditions stay strong, there's no reason why Marathon Petroleum can't continue to succeed. Its valuation isn't over-stretched, and it's throwing cash back to shareholders.

Marathon is hitting it out of the park

Marathon's revenue grew 4% last quarter, to $26.9 billion. Earnings came in at $2.95 per diluted share. This was huge 61% EPS growth year over year. As previously mentioned, Marathon's profits were helped a great deal by a very easy comparison period.

Nevertheless, Marathon put up growth across its key business segments. Marathon Petroleum's core refining and marketing segment produced 39% growth in operating profit during the quarter. This was hugely important for Marathon, since the refining and marketing segment is the company's biggest by far, accounting for approximately 92% of total operating profit.

Aside from refining, Marathon is building a midstream business. That's because it wants to diversify its business away from just one core activity. By broadening its exposure, management believes it can reap increased efficiencies and improve operational flexibility. Last quarter, Marathon stated its results were improved by its integrated system, by realizing higher prices in several of its markets.

After such strong performance, it's no surprise that Marathon's stock has rallied. Shares are up about 23% over the past year. Despite this, the valuation remains modest. Marathon is valued at just 17 times trailing earnings per share and 10 times forward EPS estimates. These are both discounts to the valuation of the broader market, as measured by the S&P 500 index.

Compelling cash returns to enhance shareholder value

In addition to a decent valuation, now might be a good time to buy Marathon Petroleum because it's throwing a lot of cash back to shareholders. After its last quarterly earnings release, Marathon Petroleum raised its dividend by 19% to its current $2 per share annualized payout. At its recent stock price, the dividend yield is a healthy 2.2%.

Not only that, but the company intends to create additional value for investors through share buybacks. Along with its dividend increase, Marathon announced an expanded share repurchase program. It's going to increase its buybacks by $2 billion. This will be on top of the remaining $709 million in the company's existing share repurchase plan. Management has a habit of using a lot of cash on share buybacks. Since its 2011 spinoff, management has increased its share buyback authorization four times.

Marathon's sprint may continue

Marathon is benefiting from tailwinds boosting its refining business. Margins are improving, which is helping profitability easily beat the low hurdles set last year. While these conditions may not always last, Marathon still trades for a fairly modest valuation. And, Marathon is returning a lot of cash to shareholders through a compelling dividend yield and billions of dollars of share buybacks. These share repurchases will help keep EPS growth intact, because reducing the number of shares outstanding makes each remaining one more valuable.

Add it all up, and now may be a good time to buy Marathon Petroleum.