The hugely profitable Midwest refiner is poised to do well even if Europe tanks, and would make a tasty treat for a value hunter like Warren Buffett, writes MoneyShow.com senior editor Igor Greenwald.

Remember the rally of the second week of August? Me neither—I had to look it up.

The market finally hit some rocks after the rapid waterfall decline that had begun two weeks earlier, bounced once, hit the rocks again, then bounced a second time.

Remember the rally that closed out August? What happened was, stocks held the bottom carved out two weeks earlier, Europe fled on vacation en masse and short-sellers covered ahead of what ultimately proved a humdrum speech by Ben Bernanke at Jackson Hole, the Fed forum where he tipped plans for quantitative easing a year earlier.

Will we remember the rally of the past three days a month from now? Or is this merely another reprieve, after a minor violation of the August lows caught all the shorts leaning the wrong way late Tuesday?

No one knows. What we do know is that all the fundamental causes of the summer bear raid—the European credit crisis, looming US austerity, the rising risks of a Chinese slump—remain unresolved.

But, on the other hand, the market has now been basing for two months, is back into the middle of that trading range and threatening to negate the recent pattern of successively lower recovery highs

Also, stocks are the only asset class earning much of anything at all, though the recent mood and price swings have understandably diminished the allure of those earnings for many.

The market’s also been discounted because the reliability of those earnings is in doubt, as 2012 estimates would tumble fast should a recession come to pass. Bernanke said this week that the recovery is close to faltering, and today’s jobs numbers didn’t quite amount to an all-clear.

Even so, however far the global slowdown proceeds, the US will have some crucial advantages over the European and Asian economies. Unlike Europe, we’re not in an existential crisis in which half the continent is increasingly uncompetitive and the other half has sentenced those losers to a permanent recession.

The US real estate bubble, unlike China’s, has had four years to deflate. China is just starting to deal with the consequences of its own imprudent lending over the last three years.

US companies reliant on relatively stable domestic demand should, in the near term, fare better than the overseas markets, or exporters. There are cheap stocks out there with steady businesses that offer some protection no matter how violently the markets yo-yo.

One I’ve been following closely is Marathon Petroleum (MPC), which as of Thursday’s close was up 10% since I recommended it last week, and 25% from Tuesday’s lows.

It’s certainly difficult to buy after a run like that, and the stock is already coming in a bit. But MPC is also down 26% from the high hit on August 1, and still sells for just four times the current year’s estimated earnings and five times the Street’s projection for 2012. In both cases, the consensus forecast has risen sharply over the last two months.

Marathon is profiting from the glut of lighter crude produced in the US interior, which currently can’t be cheaply transported either to the East or the Gulf coasts. At the same time, the price of the gasoline it sells is pegged off the East Coast’s expensive alternatives, and bolstered by growing Latin American demand for US fuel exports.

Midwest crack spreads, the gross profit margins made from refining crude, soared to records this summer and remain in nosebleed territory. They should ease over the next couple of years if the proposed pipelines for moving crude from the US interior and the Canadian tar sands to the Gulf coast come online.

But Marathon is poised to profit from that development as well, thanks to its recently refurbished big Louisiana refinery, as well as another in Detroit that will be able to process the heavy Canadian crude after costly renovations due to be completed next year.

Credit Suisse forecast this week that even after the lucrative Brent-WTI crude spread normalizes, MPC will be able to deliver a 20% free cash flow yield.

Its capital spending is poised to decline significantly within the next year, leaving more cash to be returned to shareholders above and beyond the current 2.5% dividend yield.

Marathon also owns a valuable network of fuel pipelines crisscrossing the Midwest, as well as the 1,350-outlet chain of Speedway convenience stores and filling stations.

MPC is exactly the sort of underappreciated, richly yielding asset that Warren Buffett ought to be interested in, once he gets done promoting his disappointing investments in US megabanks.

I don’t think a takeover bid is particularly likely so soon after MPC was spun off by Marathon Oil (MRO). But it is a strategic asset with excellent earnings visibility and an embarrassment of cheap nearby crude to refine into the scarcer and much costlier fuels in demand all over the world. This demand should hold up well even as Europe suffers through a recession.

The stock is down 4% in this morning’s market action after its huge rebound this week. I don’t expect this fire sale to last.