Renewable energy stocks have been on a wild ride so far this century as the industry has gone through a number of boom-and-bust cycles. We've seen some stocks soar, some of the largest solar panel manufacturers go out of business, and even finance companies go bankrupt. 

Given what investors have seen take place in renewable energy over the last two decades and where the industry is today, here's why I'm very bullish on renewable energy stocks right now. 

Wind turbines on hilly terrain.

Image source: Getty Images.

The growth story

Renewable energy is booming around the world. The chart below shows the growth of wind and solar energy production in the U.S. this century; you can see that they continue to grow rapidly. But wind and solar still only account for about 12% of all electricity generated in the U.S.

US Wind Energy Production Chart

US Wind Energy Production data by YCharts

Wind and solar are now winning against coal, natural gas, and nuclear energy based on the cost of electricity alone, so there's little doubt they'll keep growing. And as wind and solar become more economical, we're likely to see more energy storage and new technologies like hydrogen emerge. The future is bright for renewable energy, as long as the companies you buy can make money on what they produce. 

The financial picture is getting clearer

There are a number of ways to invest in the renewable energy industry, but I'll use solar as a proxy because it has more public companies than wind and a longer history in public markets than something like energy storage or hydrogen.

The solar industry has gone through a lot of changes in the last decade as costs dropped rapidly, some companies went bankrupt, and new business models emerged. Today, we're entering a more mature phase for the industry in which companies are establishing technology advantages and scale that helps create a competitive moat. The result is steadily rising profitability, which you can see below from First Solar (NASDAQ:FSLR), Enphase Energy (NASDAQ:ENPH), SolarEdge Technologies (NASDAQ:SEDG), and SunPower (NASDAQ:SPWR)

FSLR Net Income (TTM) Chart

FSLR Net Income (TTM) data by YCharts

As mature as the solar industry is getting, other segments of renewable energy are not as mature. For example, energy storage, hydrogen, and even emerging nuclear technologies are hardly financially stable and closer to being in the nascent stage of the business cycle than maturity. 

The good news for investors is that we can find profitable companies with a competitive moat in renewable energy, which hasn't always been the case. 

How to invest in renewable energy today

I bucket renewable investments into three categories: financiers, solar stocks, and speculative investments. And there are good opportunities in all three

Financiers are the companies that build or buy renewable energy projects, usually with long-term contracts to sell electricity to a utility. They generate very stable cash flows and often come with a dividend. Brookfield Renewable Partners (NYSE:BEP) and NextEra Energy Partners (NYSE:NEP) are both leaders in this space and have exposure to wind and solar energy projects. They're also starting to acquire new technology projects like energy storage, which can provide a service to the grid. The reality of the energy business is that a lot of money needs to be invested to build projects and generate renewable electricity -- and Brookfield Renewable Partners and NextEra Energy Partners are keys to making clean energy a reality. 

I focus on the solar industry in part because there are very few wind-focused companies publicly traded in the U.S. But in solar energy there are some leaders with clear differentiation, like First Solar in solar panel manufacturing, SunPower in deploying residential and commercial solar, and Enphase Energy in module-level power electronics. All three companies are riding the wave of solar energy growth and have emerged as industry leaders as competitors have declined. 

On the speculative side, I see a huge opportunity in hydrogen. Bloom Energy (NYSE:BE) is an industry leader in solid-oxide fuel cells; it's also built a nearly $1 billion business in backup power with new markets like electrolysis and marine power on the horizon. If costs continue to drop, Bloom Energy could be a big winner in the hydrogen industry. 

Whether you want to take a risky bet on Bloom Energy, a safer investment in Brookfield Renewable Partners, or something in between, there's something for everyone in the renewable energy industry. And as the industry matures we should see profitability rise as well, which is good news for investors who can buy and hold the industry's best companies long-term. 

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.