Solar power is set to play an increasingly important role in meeting global energy needs in the coming decades. The U.S. Energy Information Administration projects that the share of renewable sources in the country's power generation sector could double -- from 21% to 42% -- by 2050. Further, it expects solar energy to account for a little less than half of the renewable electricity generation by that year. 

Though the expected growth in solar power is clear; what isn't as clear is which stocks should you invest in to benefit from this growth. Here are three top solar stocks to consider adding to your solar portfolio.

Canadian Solar

Among solar panel manufacturers, Canadian Solar (CSIQ 3.89%) looks interesting. In addition to manufacturing solar panels, the company is also involved in the development and sales of solar projects. Canadian Solar derives roughly 47% of its revenue from Asia, 35% from Americas, and 18% from Europe and everywhere else.

Canadian Solar has been growing its revenue steadily over the years. In the second quarter, its revenue grew 105% over the pandemic-affected Q2 last year.

CSIQ Revenue (Quarterly) Chart

CSIQ Revenue (Quarterly) data by YCharts

The company expects to generate 14% to 16% gross margin in the third quarter. As the above graph shows, Canadian Solar is focused on growing revenue. It intends to continue expanding margin over time. Canadian Solar stock is trading at an attractive forward price-to-earnings ratio of nearly 14, compared to around 36 for First Solar (FSLR 0.71%) and 11 for JinkoSolar (JKS 1.21%)

In addition to solar panels and projects, battery power is a key growth avenue for Canadian Solar. It has 3 megawatt-hours of battery storage in operation. Further, it has 1.5 gigawatt-hours of storage under construction with 0.8 GWh in its late-stage pipeline. Moreover, the company has 17 GWh of battery projects in the early or mid-stage pipeline.

Enphase Energy

Enphase Energy (ENPH 3.79%) is a leading supplier of microinverters, which convert direct current generated by solar panels into alternating current -- a necessary step before the generated power can be used. The company has been growing its revenue impressively, with the latest quarterly revenue rising 152% over the year-ago quarter.

Young man cleaning solar panel.

Image source: Getty Images.

Additionally, Enphase has been generating remarkable gross margins. In the second quarter, its gross margin stood at 40.4%. Enphase expects its gross margin to range from 37% to 40% in Q3. Enphase Energy's notable growth comes after the company adopted a key financial target of generating a minimum 35% gross margin, while restricting operating expenses to less than 15% of sales. All in all, the company looks well-placed to continue growing in the years to come.

SunPower

Over years, SunPower (SPWR -3.17%) has changed its growth strategy and focus quite a few times. It now focuses on residential and commercial solar solutions with an asset-light strategy. After the spin-off of its panel manufacturing business, Maxeon Technologies, SunPower's financial performance numbers are not directly comparable to its historical performance. However, the company seems to be doing well so far.

SPWR Revenue (Quarterly) Chart

SPWR Revenue (Quarterly) data by YCharts

In the second quarter, the company's gross margin improved to 19.8% from 11.8% in the year-ago quarter. It added 13,000 residential customers during the quarter and has a total residential customer base of 376,000. Moreover, SunPower grew its new homes backlog by 10% sequentially. 

SunPower has several attractive growth avenues. In addition to residential solar installations, the company is focusing on battery storage. In Q2, 23% of its residential customers also opted for SunPower's battery storage. Further, the company recently partnered with Wallbox, a provider of electric vehicle chargers, that will allow homeowners to charge their EVs with electricity generated from rooftop solar. 

Overall, SunPower's recent progress looks promising. The stock looks well-placed to benefit from the expected growth in the residential solar market.