Image source: Getty Images.

The solar industry may be the biggest investment opportunity in a generation. Bloomberg New Energy Finance recently predicted that $3.7 trillion will be invested in solar power by 2040. But on the stock market solar investments can't seem to get any love, largely because so many companies have gone belly up in the past. Solyndra, Evergreen Solar, Suntech Power, and SunEdison are just a few of the companies that once held a lot of promise but ended with investors losing everything. 

For an industry with such big potential there are sure to be a few winners long-term and given what we've learned in the last decade in solar here's a checklist of what you should be looking for.

1. The balance sheet has to be rock solid and flexible

If you look back at the solar industry's failures in the past the first thing you'll notice is a lot of leverage. Solar companies have used debt to build manufacturing plants and companies like SunEdison used billions in debt to build power plants. And debt kills.

Two companies with solid balance sheets and good strategies around maintaining that strength are First Solar (FSLR 0.43%) and SunPower (SPWR -2.21%). They had $1.1 billion and $555.2 million in cash on hand respectively at the end of last quarter, giving flexibility in operations going forward. But it's flexibility in how they finance and sell projects that keep the balance sheet strong. Both can build projects on the balance sheet, sell them to third parties, drop them down to their co-owned and operated yieldco 8Point3 Energy Partners, or a combination of the three.

Contrast that with SolarCity (SCTY.DL), which is attempting to build solar assets on its balance sheet. It is in constant need of financing to build projects and doesn't have a plan to sell assets to third parties at all. As a result, debt keeps piling up, which hasn't typically ended well for solar companies.

FSLR Total Long Term Debt (Quarterly) Chart

FSLR Total Long Term Debt (Quarterly) data by YCharts

2. Make sure the company does something different

As the solar industry exploded in the early 2010s it benefited from dozens of Chinese solar manufacturers buying equipment and building out factories at massive scale. This helped lower costs, but each company was essentially building the same thing, so there was no differentiation. Companies like Suntech Power, LDK Solar, and Yingli Green Energy that built commodity capacity with a lot of debt eventually went bankrupt, or in Yingli's case are close to it.

Image source: Getty Images.

You can see this even in companies that have survived. Trina Solar (NYSE: TSL) and Canadian Solar (CSIQ -0.83%) are two of the largest solar manufacturers in the world, but they have extremely low margins because they don't have any differentiation. And the only reason they're making money today is their project development business.

Differentiation, whether it's efficiency or design or cost is key to all solar companies. SunPower makes the most efficient commercial solar panels in the world, making it competitive in projects large and small. First Solar has rapidly improved its efficiency in the past two years to pass commodity products and is one of the best project builders around.

3. Don't just a supplier, create the demand

Being a component supplier in the solar industry has been a disastrous spot for a lot of companies. Whether it's solar panels or inverters or racking, component suppliers rarely control their own destiny.

That's why investors should look for companies that are able to control demand by building solar projects. That way it's much harder to be replaced by competitors.

If you look at the strategy First Solar, SunPower, Trina Solar, and Canadian Solar have taken you can see the importance of project development to their business. Each company bids on projects with utilities or builds systems under existing rules that allows them to create captive demand for their solar panels and creates another way to differentiate themselves.

If you look at the future of energy, where customers are going to demand things like energy storage, monitoring software, smart controls, demand response, and other services it's the developers who will be able to bring together those offerings. The solar panel itself is an important component, but without the ability to turn that into a holistic product offering there's little chance to differentiate yourself and control your own destiny.

The keys to making money in solar

As you're looking into solar stocks, make sure to look for companies with a strong and flexible balance sheet, a way to differentiate themselves in the market, and a downstream business that will generate consistent demand. If you find all three of those things you'll have a chance to make money in an industry with trillions of dollars in market potential.