The outlook for the long housing market recovery continues to be promising.

The latest boost came last week with the news that existing home sales were up -- with first-time buyers the surprising drivers. Moreover, October's Housing Market Index, a gauge of builder sentiment, is at its second-highest level for the past year.

But the market for housing stocks doesn't reflect this. While the S&P 500 index is up nearly 5% over the past year, various housing stock indices are down by nearly as much over the same period. The big difference has been the sharp fall of housing stocks by about 10% since July.

The contrast between the market and the business prospects could present investors with some good opportunities to buy housing stocks at prices not seen in many months. But investors will have to proceed with caution. The housing market is a huge part of the economy and they won't find good investments just anywhere, particularly with this downward pressure.

Some of the potentially best investments in the housing market are among the most visible. The biggest names -- Home Depot (HD - Get Report) , Lowe's (LOW - Get Report) , D.R. Horton (DHI - Get Report) and Lennar (LEN - Get Report) -- all at the top of their industries, were stellar performers throughout most of the recovery and, while they've been hurt lately, their future appears healthy.

Home Depot comes first not just because the home improvement company is the largest pure play in housing. The risks may be the lowest of the four stocks, as Home Depot has suffered the least during this recent downturn and it also has excellent earnings prospects.

Home Depot is expected to grow at double-digit rates out to five years. Not surprisingly, a consensus of analysts, according to Zacks Investment Research, rate the home improvement company's shares a strong buy. A dividend of 2.1%, which beats the other three stocks, is a not insignificant plus in the current near-zero interest rate environment.

Lowe's stands in Home Depot's shadow, but that may be to investors' advantage. It has similar strong backing from analysts and good earnings growth potential. For investors willing to take on the risk, Lowe's may have greater upside potential since its stock was hit twice as hard as Home Depot during the past three months.

Horton and Lennar are also the leaders in their business, which is homebuilding. The closest to being a national developer, Horton sells more homes than Lennar. However, Horton's lead is much less when it comes to earnings and market capitalization. Lennar builds and sells more expensive homes, though buyers for both builders are still in the broad middle class.

Both business models are expected to keep working over the next five years, with a consensus of analysts forecasting double-digit earnings growth for both companies. Horton and Lennar stocks were hit harder than Home Depot and Lowe's, with Lennar suffering the most. Yet, with a price-to-earnings ratio of 11 -- lower than the three other companies -- Lennar may be the best bargain of them all.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.