Solar stocks have taken a beating over the past year, and the slump has continued in 2017, with many top companies off by 50 percent or more in the past 12 months. That's a tough pill to swallow for investors who've watched solar stocks soar in the past due in part to federal tax credits for home solar installation and other incentives to stimulate the industry. (See also: Are Solar Stocks Set for a Rebound?)

A number of factors are behind the rapid decline – a sharp decrease in demand from China, lowered Japanese tariffs and the expected expiration of the tax credits at the end of last year (which were ultimately extended to 2021). Right now, there's a glut of solar panels driving prices down. (See also: A Look at Solar Energy Earnings.)

However, the facts on the ground suggest that solar's fortunes may improve over the medium and long term. Consider that solar energy use is skyrocketing – nearly 40 percent of all new energy installations in 2016 were solar. The solar workforce has tripled since 2010, reaching some 270,000 workers currently, edging out the number employed in natural gas and nearly doubling the number employed by coal. Of course, there's uncertainty under the new Trump administration, which may not pursue the aggressive alternative energy policies of the previous administration. (See also: 2017: A Turning Point for the Solar Industry.)

That said, depending on your point of view, depressed stock prices may mean that the time is right to jump into solar. If you're considering solar exposure for your portfolio, here are the top picks for 2017. Note: All figures current as of April 12, 2017.

First Solar, Inc. (FSLR)

The good news is that First Solar's fourth quarter revenue figures beat analyst expectations by about $65 million. The bad news is that revenue was barely half what it was for the same period in 2015. The stock is off 55 percent over the past 52 weeks and hovering at $27.70 per share, down from a high of over $74 last May. The stock was downgraded from Outperform to Hold last November.

First Solar has a market cap just under $3 billion, and recent guidance suggests that it will have about $1.5 billion in net cash on the balance sheet by the end of 2017, a reassuring figure. There's 15 percent potential upside if the stock hits its 12-month price target of $32 this year. (See also: Is First Solar a Great Deal or a Trap?)

SunPower Corporation (SPWR)

SunPower lost more than two-thirds of its value over the past year, a figure that strikes fear in the heart of the average investor. Bankruptcy is a definite concern with some solar companies, but SunPower is majority owned (66 percent) by petroleum giant Total S.A. (TOT), which is propping it up with credit and even purchasing solar panels for its 5,000 gas stations. At $6.66, SunPower stock is up marginally from its 52-week low of $5.84 on March 17 – and down precipitously from its $22.36 high last April.

The company has a market cap of just under $1 billion, but it reported revenue last year of $2.52 billion, up 62 percent. However, income was down markedly – the company reported a loss of $471 million in 2016. The stock has an $8 price target, about 20 percent above its current price. (See also: Clean Energy Stocks Gain Despite Trump Stance.)

Canadian Solar Inc. (CSIQ)

Canadian Solar is one of the largest solar panel manufacturers in the world, with operations in North and South America, Europe, Africa, the Middle East and Asia. It is sitting on 5.8 GW of module capacity, easily positioning itself to capture more market share than any of its competitors. Canadian Solar survived the solar downturn better than others in the space, losing just 30 percent over the past 12 months.

The company has a $730 million market cap and reported revenue of $2.85 billion last year, with net income of $65 million, down 62 percent over 2015. However, the stock could outperform this year due to strong margins and inventory control. (See also: Dark Clouds Over Canadian Solar in 2017.)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.