If you missed the best week to buy stocks, you might be kicking yourself. I know I am. The market is, after all, up 40% from its March 9 low.

But just as it was unwise to panic-sell when everyone around us was losing their heads, it's equally unwise to panic-buy now that the market is in rally mode.

The sudden switch in investor sentiment -- from stocking up on gold, potatoes, and ammunition in early March to "everything's going to be OK" just four months later -- is reason enough to be skeptical of this rally.

The key to investing success, as always, is being patient and continuing to buy quality companies trading at good values. This rally, however, has largely been led by inferior companies that had been heavily shorted and left on death's doorstep.

Trying to hitch a ride on them now may be tempting, but proceed with caution.

Garbage-pail kids
Following a string of notable bankruptcies, from retailers like Circuit City to once-vaunted financial institutions like Lehman Brothers, investors rightly began to wonder who would be the next to fall.

Indeed, the futures of a number of well-known but heavily indebted American institutions were in serious doubt. Gannett (NYSE:GCI) and Las Vegas Sands (NYSE:LVS), for example, were at one point in March trading at $1.85 and $1.38, respectively. Both companies have naturally been under tremendous pressure to shore up capital and responded by trying to sell assets, cutting jobs, and -- in the case of Gannett -- slicing the dividend by 90%.

Since March 9, Gannett shares have gained 283% and Las Vegas Sands an incredible 668%. These are just two examples of the recent "dash to trash" in this market rally. Consider the profile of the 472 U.S.-based companies with current market caps over $500 million that have gained more than 100% since March 9:

 

Debt-to-Equity

Net Income (LTM)

Return on Capital

Median

79%

($8 million)

4.8%

Source: Capital IQ, as of Aug. 5, 2009.

Put simply, this rally's been largely led by weak hands. While it may be tempting to jump on this bandwagon now, these are the worst stocks to buy today, especially since we're not completely out of the economic woods just yet. If things take a turn for the worst again, chasing these stocks could be a very costly mistake.

Instead, investors (as opposed to speculators) should focus on profitable companies that generate free cash flow, that have a track record of rewarding shareholders with efficient use of capital, and that have strong balance sheets.

These are the types of companies that will emerge from macroeconomic turmoil even stronger than before.

Names, please
Despite the recent rally, there are still many quality companies trading at reasonable valuations that are worth further research, including the following.

Company

Price to Free Cash Flow

Return on Equity

Microsoft (NASDAQ:MSFT)

13.3

38.4%

General Dynamics (NYSE:GD)

11.1

21.4%

WellPoint (NYSE:WLP)

9.5

11.2%

Raytheon (NYSE:RTN)

10.2

16.1%

Automatic Data Processing (NYSE:ADP)

13.1

23.0%

Source: Capital IQ.

Given their size, you shouldn't expect any of these companies to become a seven-bagger in a matter of months the way Ruby Tuesday did recently, but you can sleep a little better at night knowing that your management team isn't slashing dividends or selling assets just to pay the bills. In fact, Raytheon recently increased its dividend 11%, and General Dynamics repurchased 10 million shares last quarter.

Foolish bottom line
After sustaining significant losses over the past year, it may be tempting to chase after struggling companies that have had huge run-ups in this rally, but do your best to not lead yourself into that temptation. If buying distressed stocks was a gamble in early March, it's an even bigger gamble now that many have soared in price. Another downturn in the market and they could be going from heroes back to zeroes -- literally.

The market's still a volatile place, so remember to stay patient and focused on buying the companies that actually turn a profit, have strong balance sheets, and are led by top-notch management. Begin by building a watchlist of stocks that you'd love to own if they fall another 10% to 20%. This way, you're ready to strike when the market gives you the opportunity.

Want to get started? You could do worse than to start your research with Netflix, one of Fool co-founder Tom Gardner's recommended core holdings for Motley Fool Stock Advisor. It's a consistent free cash flow generator and is led by one of the country's top CEOs in Reed Hastings, who is also the founder of the company.

If you'd like to learn about the other stocks we're recommending at Stock Advisor, a free 30-day trial of the service is yours. Just click here to get started.

Already a Stock Advisor subscriber? Log in at the top of this page.

This article was first published on July 7, 2009. It has been updated.

Todd Wenning hopes you're having a pleasant day. He does not own shares of any company mentioned. General Dynamics, Microsoft, and WellPoint are Motley Fool Inside Value selections. Automatic Data Processing is a Motley Fool Income Investor recommendation. The Fool's disclosure policy takes out the trash.