Image source: Getty Images.

The solar industry has trillions of dollars in market potential, and now that many flash-in-the-pan companies have gone bankrupt, some real leaders in the industry are starting to emerge. But the stock market still isn't giving solar stocks much love. If you're looking for a great long-term opportunity, here are three stocks to consider.

First Solar

One of the most underappreciated stocks of the past decade in the solar industry is First Solar (FSLR -0.46%). The company is one of the most consistently profitable solar companies and has margins that are the envy of the industry.

FSLR Net Income (TTM) Chart

FSLR Net Income (TTM) data by YCharts.

But what's more impressive is the company's ability to adapt to new market realities in solar. Over the last few years, First Solar has invested in increasing efficiency of its solar panels to 16.2%, which is now above many commodity Chinese panels it used to lag behind. And management has a goal of reaching the 20% efficiency point in the next few years.

But what will make First Solar more valuable going forward is its fully engineered turnkey solar solution for large-scale projects. It's designed a system that will be easy to install, could include energy storage, and will be more efficient than many competitors. That's a recipe for success and continued profits long-term, and with shares trading at just 6.4 times trailing earnings, I think there's upside galore.

8point3 Energy Partners

One of the newer ways to play solar energy is through yieldcos, which own renewable energy projects and pay investors dividends based on their cash flows. 8point3 Energy Partners (CAFD) is a creation of First Solar and SunPower, which jointly run the company, and it's an incredibly cheap stock given its potential.

The company projects a $0.2406 per share quarterly distribution this quarter, which amounts to a 5.6% dividend yield at today's price. But the company is also buying projects that will add to that dividend long-term. So far, management has increased the dividend at a 15% annual rate, with a long-term target of 12% to 15%. And management says it's going to be able to keep up that growth for the next couple of years, at least.

What separates this yieldco from others is the joint-sponsor structure, which keeps the company disciplined in its balance sheet as well as what it pays for projects. With First Solar and SunPower keeping a long-term view of the solar industry, I think this is a stock to buy and hold for decades to come. 

Image source: Getty Images.

Vivint Solar

First Solar and 8point3 Energy Partners are stable and cheap stocks, but my third pick is a little riskier. Vivint Solar (VSLR) is a residential solar installer which was once an acquisition target of SunEdison. But the deal fell through and the company's stock took a nosedive as a result, today commanding just a $334 million market cap. And that's where the opportunity lies for investors.

Vivint Solar has $2.1 billion in contracted payments from customers and $1 billion in projected retained value. Even when you pull out the company's $500 million in long-term debt, there should be more value in existing contracts than the market is pricing in. And Vivint Solar could take advantage of some major changes taking place in the solar industry.

Its biggest competitor, SolarCity, is in the process of potentially being acquired by Tesla Motors, and if Vivint Solar's situation was any indication, that will leave SolarCity weakened in the near term. But the bigger news could be residential solar customers changing preferences to loan financing. Vivint Solar has a loan product through Mosaic, and if it pivots to be a leader in that portion of the industry, it could take market share and make more money immediately for investors. 

Vivint Solar isn't a low-risk solar company, but with the right execution, we could look back on 2016 as a time when the stock was ridiculously cheap.

An industry with a bright future

The solar industry has a multitrillion-dollar market opportunity, and First Solar, 8point3 Energy Partners, and Vivint Solar are all likely to be big beneficiaries of its growth. But investors aren't giving their stocks much love. This makes them ridiculously cheap for investors willing to buy and hold -- for the potential of solar energy to turn into a profit-making reality.