It's no secret that we are in the midst of a solar shakeout right now. Solyndra, Evergreen Solar, Solar Millennium, and Solon have already closed up shop, and a number of small competitors are on the ropes right now.

So how can you avoid making the mistake of buying into the next solar failure? Here are a few tips.

Don't buy into "cool" technology
Last year when I said anything bad about Energy Conversion Devices, readers would question my sanity, as you can see here or here. Now the stock is trading for $0.30 and the company seems destined for the trash heap.

The reason is simple: Energy Conversion Devices made "cool" technology that wasn't cost-effective. The company's solar shingles never caught on and its thin film product was very inefficient. With traditional polycrystalline modules falling in price, the flaws in that investment thesis became gaping holes by the end of the year.

The same can be said for Solyndra, which made modules out of CIGS that looked really cool when they were shown on TV. We all know how that ended up.

Don't buy a bad balance sheet
Chinese manufacturers have built themselves on short-term borrowings from Chinese banks. That poses all kinds of risks including the possibility that funding will be pulled out from under them, a risk I don't want to take. LDK Solar (NYSE: LDK) and Suntech Power (NYSE: STP) are two of the biggest borrowers, and this leaves their balance sheet highly leveraged.

Keep a close eye on where a company gets its funding from -- and the less debt it has, the better.

Have a backup plan
Many manufacturers are counting on someone else for demand. Suppliers like LDK Solar and Renesola (NYSE: SOL), for instance, count on other manufacturers for demand for polysilicon and solar cells. As manufacturers vertically integrate and supply outpaces demand, they're left holding the bag if demand falls short.

On the other hand, First Solar (Nasdaq: FSLR) and SunPower (Nasdaq: SPWR) are not only vertically integrated in manufacturing, they own power-plant development units that provide a backstop when times are tough.

That backup plan is key for companies in tough times.

Buy proven technology and a big balance sheet
I own two solar stocks, First Solar and SunPower, because both produce proven technology, have a competitive advantage in both cost and efficiency, and have strong balance sheets. SunPower even has a multinational oil company, Total, backing it for when times get rough.

If you follow my advice above and don't fall in love with "cool" technology, stay away from bad balance sheets, and always have a backup plan, solar can be a great investment in coming years as weak competitors fall from the race.

I think SunPower and First Solar are great picks for the future, but our analysts have selected a different stock that they believe is poised for tremendous growth in 2012. Find out which company in our new free report: "The Motley Fool's Top Stock for 2012." Thousands have already requested access, and it'll only be available for a limited time. Simply click here -- it's free.