(Money Magazine) -- The time to make money in the stock market is not when things are going gangbusters, but when things look as if they're going bust. Just ask anyone who invested in beaten-down U.S. stocks after the market sank in the immediate aftermath of 9/11.

Well, such a time may be here again. As you may be painfully aware, the credit crunch has mothballed a fleet of stocks that a few years ago were among the market's highest fliers. Shares of home builders, real estate investment trusts and financial companies have already lost a quarter to more than half of their value.

Of course, just because these sectors are down doesn't mean that they won't fall further. But after more than a year of witnessing these stocks get pummeled, bargain hunters are starting to take notice.

"I think we are going to look back a few years from now and see that this was a big opportunity," says David Dreman, whose firm, Dreman Value Management, has been buying financial stocks on this dip.

Even if you agree, you need to be careful. Yes, there are bargains to be had, but there's still a lot of junk out there. Here's a guide to separating the gems from the scrap.

Financial stocks

Why they've been mothballed Last year, earnings for financial companies in Standard & Poor's 500 plunged $75 billion, stemming largely from mortgage-related losses. Some banks took on too much risk by extending loans to homeowners with poor credit. Others lost by betting on bonds tied to bad mortgages.

Tens of billions in losses have already been written off, but analysts say there could be another $150 billion in losses to come.

Why they could recover Enter the Federal Reserve, which has been aggressively slashing interest rates since last September to stave off recession. Historically, financial stocks have enjoyed solid double-digit gains in the year following the start of Fed rate cuts. And as Money Magazine's Michael Sivy noted, the sector could soon stabilize.

Finally, there are dividends to consider. Financials are yielding 3.2% vs. around 2% for the S&P. So even if it takes time for this sector to take off, you'll be paid to wait.

Sifting through the salvage yard Opportunities among the financials can be divided into two categories: companies that have already taken their lumps (and now have little downside left) and those that have done a better-than-average job avoiding the mortgage mess - but have been punished anyway.

Merrill Lynch (MER, Fortune 500) falls into the former group, having already written down the riskiest portion of its mortgage bond portfolio by nearly 70%. But after losing around 45% of its value, the stock now trades at just 1.3 times its book value - less than the industry average of 1.8.

"The company has a new CEO and it is getting more conservative," says David Katz of the Matrix Advisors Value fund, which owns Merrill shares.

For its part, Wachovia (WB, Fortune 500) is among the largest mortgage lenders. But thanks to its stricter-than-average lending standards, it's had to write off less than half the amount of bad loans as rival Bank of America. Yet the stock still fell by 40% and trades at a P/B ratio of 0.9. "The market has overreacted," says Dreman.

Regional banks, whose shares have been punished (even though these firms haven't ventured much into subprime lending), are another way to go. But since many regional bank stocks are small-cap or midcap names, it may be safer to invest in them through a diversified fund. The KBW Regional Bank ETF (KRE) holds 50 stocks and yields 3.8%.

REITs

Why they've been mothballed Most real estate investment trusts aren't directly tied to housing, but they're affected by the slowing economy. If business activity slows, there would be less demand for space in the office buildings and malls that REITs own and manage. What's more, REITs grow by borrowing money to acquire or build new properties. And getting loans has gotten harder and more expensive.

Why they could recover REIT shares are cheap. Over the past 20 years, REITs have traded at a 4% premium to the net value of all their properties. Today the average REIT trades at a 20% discount. "Whenever you have seen REITs at these levels, it has always been a great buying opportunity," says James Coral, head of real estate securities at Cohen & Steers.

As for the economy, a slowdown could hurt REIT rental income. But many companies sign leases for 10 years or longer, so they're stable tenants. On top of that, REITs are a natural hedge against inflation.

Sifting through the salvage yard REITs are notoriously hard to analyze. Some own a mix of retail, commercial and residential space. And many own buildings in different cities, each with its own economic trends.

So you're better off going with a professionally managed fund like Third Avenue Real Estate Value (TAREX), which is in the Money 70, our recommended list of funds. This portfolio spreads its bets by buying properties here and abroad. This has helped limit its losses lately. Since the start of 2007, it has fallen 14% vs. a 19% decline for the average real estate fund and a 24% drop for REITs.

Home Builders

Why they've been mothballed At the height of the real estate boom, houses were going up faster than you could say "flip my condo." Now all those units need to be sold, and builders are having to unload their inventory as prices are falling. So far, builders have written down their holdings by $20 billion, and Ivy Zelman, CEO of Zelman Associates, expects those write-downs to continue.

Why they could recover Shares of home builders have been beaten down so much that some think they're due for a bounce back. It may already be happening. Over the past month the sector has soared 38%.

Still, even Toll Brothers (TOL, Fortune 500) CEO Bob Toll isn't optimistic. "We're not yet seeing much light at the end of the tunnel," he recently said.

Sifting through the salvage yard With home prices expected to continue to fall through 2009, perhaps by as much as another 15%, it's still probably too soon to buy home builders. Even Ron Muhlenkamp, who has owned them in his Muhlenkamp Fund for years, isn't ready to add to his position just yet. He says it is too hard to get a read on how much further sales will fall and for how long.

Meanwhile, other investors are worried that the home builders have taken on too much debt. Says Katz of Matrix Advisors: "Expect more bankruptcies."