Bet against the masses. Don't be the lemming. Be fearful when others are greedy.

Follow these simple rules, and you'll probably be a successful investor.

With those rules of thumb in mind, you'd be forgiven for thinking now is a terrible time to buy stocks. The S&P 500 is up more than 30% over the past three months or so, which is typically consistent with a market flooded with unrestrained optimism. Sure enough, some investors are preaching of an overvalued market that's gotten way ahead of itself.

Oh really?
And maybe they're right. But perspective is in order: When stocks bottomed out in early March, a better part of the investment community thought the world was about to explode. Companies like Bank of America (NYSE:BAC) and Citigroup (NYSE:C) traded for trivial valuations because, quite literally, their deaths looked imminent.  

Today, it looks like we've skirted most of those calamitous end-of-the-world threats. It's still terrible, mind you, just not as terrible as many thought. Naturally, stocks have sprung back to levels that reflect a deep recession, rather than a total Mad Max scenario.

This is an incredibly important distinction to make: Markets haven't risen to levels reflective of future optimism, but to levels consistent with a world that isn't about to fall into mass insolvency.

This is evident by looking at the biggest winners over the past few months. By and large, the stocks that have risen the most are ones you wouldn't recommend to your worst enemy. Have a look:

Company

3-Month Return

2009 EPS Estimates

Dollar Thrifty Automotive

756%

($0.85)

Avis Budget Group

430%

($0.66)

ArvinMeritor

188%

($1.24)

Data from Yahoo! Finance and Google Finance.

Are these companies destined for greatness? Did they announce a new blockbuster product? Are they the next Google (NASDAQ:GOOG), revolutionizing the way we access information in our everyday lives? Goodness, no. Not even close. Their huge gains are simply a reflection that they'll live to see another day.

This is a rally built on canceling out past pessimism, not pricing in future optimism. The biggest gains have been concentrated in very low-quality companies that are simply being given a second shot at life.

Not all gains are created equal
The idea that a stock is overvalued after a massive run-up is contingent on the idea that it was properly priced to being with. But this was hardly the case when the market bottomed in March. More importantly, some of the highest-quality companies in the world have largely been left out of the rally and still trade at attractive prices.

Here are three in particular:

Company

3-Month Return

Forward P/E Ratio (FY 2009)

Berkshire Hathaway (NYSE:BRK-A)

(1.9%)

16.0

Procter & Gamble (NYSE:PG)

8.3%

13.2

Altria (NYSE:MO)

(0.4%)

9.5

Data from Yahoo! Finance.

What's to like about these three? Glad you asked:   

  • We gab about the awesomeness of Warren Buffett enough here at the Fool, so I won't bore you with warm and fuzzy stories. I'll just give you the numbers: Over the past 15 years, Berkshire Hathaway has traded for an average of 1.91 times book value; today it trades for 1.30 times book value. I find that very intriguing, and think you should, too.
  • Whether you know it or not, you probably use several Procter & Gamble products. Its strong brands -- which range from Gillette to Cascade to Tide -- are in your bathroom, kitchen, and laundry room. Since 1994, P&G shares have traded at an average of more than 26 times earnings. Today, you can pick them up for 13 times earnings. That's the kind of opportunity that makes investing in recessions such a blast.  
  • Altria -- maker of Marlboro cigarettes -- is a staggeringly simple business that generates huge amounts of cash. Investors are nervous about new regulations that put tobacco under the watch of the Food and Drug Administration and restrict tobacco advertising. But oddly enough, the new regulations may actually benefit Altria substantially. Limits on tobacco advertising make it harder for other cigarette makers to challenge Altria’s dominant market share. This would be a huge moat that few other businesses have -- the government is, in effect, limiting competition. If you're looking for international diversification, global sibling Philip Morris International (NYSE:PM) offers a lower yield but more growth opportunity.

Onward
Perspective can be a powerful thing: One year ago, Dow 8,500 would have been associated with the end of the world. Today, some want to treat it like it symbolizes irrational exuberance simply because we've bounced so far off the March lows. This is inherently flawed thinking. Focusing on a stock's percentage change over a short period of time is utterly meaningless. Drilling down on a company's intrinsic value and buying bargains like we haven't seen in decades is what's important.

And that's why our Motley Fool Inside Value team of analysts is having a field day digging through the rubble and finding cheap stocks like never before. If you’d like to see what they're recommending right now, click here to try the service free for 30 days. There's no obligation to subscribe.

Fool contributor Morgan Housel owns shares of Berkshire, Altria, Procter & Gamble, and Philip Morris International. Google is a Motley Fool Rule Breakers recommendation. Berkshire Hathaway is both a Motley Fool Stock Advisor and Motley Fool Inside Value pick. Procter & Gamble is a Motley Fool Income Investor recommendation. Philip Morris International is a Motley Fool Global Gains pick. The Fool owns shares of Procter & Gamble and Berkshire Hathaway and has a disclosurepolicy.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.