The world is slowly shifting away from fossil fuels and toward cleaner sources of energy. In the last five years alone, companies and governments have spent $1.5 trillion on renewable-energy technologies. According to one estimate, we need to invest another $10 trillion to replace the current carbon-based power systems in the largest energy-consuming markets alone. It's a vast opportunity that could enrich those who invest in the companies best positioned to capture a meaningful share of this fast-growing market.

Two companies focused on opportunities in the renewables market are Ballard Power Systems (BLDP -1.10%) and TerraForm Power (TERP). Here's a look at the investment case for these two renewable-power companies. As will become clear, one company stands out as the better buy for the long haul. 

Solar panels, wind turbines, and fuel cells on green grass with a blue sky in the background.

Image source: Getty Images.

The bull and bear case for Ballard Power Systems

Ballard Power Systems makes fuel cells, which produce an electric current from a chemical reaction. Fuel cells could replace diesel in powering buses, heavy trucks, trains, and passenger ships. It's a massive addressable market, with the transit bus market opportunity alone being worth upward of $4.6 billion in annual revenue by 2022, according to the company. Given that Ballard has only generated about $100 million in revenue over the past 12 months, it has significant upside potential.

However, while the addressable market for fuel cells is enormous, it has lots of competition. Cleaner-burning natural gas has already made inroads in each of these markets because it's cheaper than fuel cells. Meanwhile, improving battery technology is leading many companies to choose batteries over fuel cells for the heavy-duty transportation market. Because of that, Ballard Power Systems' fuel cells might not win as much market share as it hopes. That could force the company to shift its focus to niche markets such as forklifts and airport vehicles instead of chasing after bigger market opportunities. If that's the case, the company might not grow all that much in the coming years, which could weigh on investment returns.

A wind turbine with the sun shining brightly.

Image source: Getty Images.

The bull and bear case for TerraForm Power

TerraForm Power, on the other hand, operates wind- and solar-power-generating facilities across North America and Western Europe. The company sells the electricity generated by these plants under long-term contracts or at regulated prices to utilities and other end users, enabling it to produce predictable cash flow. The company returns about 80% to 85% of that money to investors via its dividend, which currently yields 6.9%.

TerraForm Power reinvests its excess cash into projects that will increase its cash flow such as repowering its wind farms with newer turbines, adding energy storage capabilities to its sites, or expanding them. In addition to that, it holds options with developers to acquire some of their projects. Meanwhile, the company can also make larger-scale acquisitions, which it did earlier this year when it bought a portfolio of wind and solar assets in Western Europe for $1.2 billion. 

That acquisition, when combined with its internal initiatives to boost earnings, will provide the company with enough power to grow its dividend at a 5% to 8% annual pace through 2022. Meanwhile, with wind and solar currently accounting for more than 75% of the total global renewable investment, the company should have plenty of opportunities to expand its portfolio in the coming years.

If there's one drawback to TerraForm Power, it's that the company's balance sheet isn't as strong as it needs to be to capture the growth it sees up ahead. While Ballard Power has a debt-free balance sheet, TerraForm Power has a sub-investment-grade credit rating due to the lingering effects of an acquisition binge led by its former parent company. It has a new sponsor now that has made shoring up TerraForm's balance sheet a priority. The company has come a long way over the past year and is in a better spot with no near-term debt maturities and lots of liquidity, which gives it the flexibility to take advantage of compelling acquisition opportunities that may arise.

Verdict: TerraForm Power is a better buy

While Ballard Power has a huge addressable market, alternative options seem to be winning over the lion's share of the opportunities. TerraForm Power, on the other hand, is right in the sweet spot of the renewables market given its focus on building and buying wind- and solar-power-generating facilities. Meanwhile, it focuses on owning assets that produce predictable cash flow, which enables it to pay a growing dividend. That dividend growth alone positions TerraForm Power to potentially generate double-digit total annual returns over the next several years, which makes it the better stock to buy for the long haul.