The U.S. stock market might be on track for its eighth consecutive yearly gain, but one sector that’s missed the party is solar energy.

Since the beginning of the year, exchange-traded funds tied to solar stocks such as the Guggenheim Solar ETF (TAN) and VanEck Vectors Solar Energy ETF (KWT) have fallen 30 percent and 31 percent respectively. Compared to the S&P 500, which has climbed 7 percent year-to-date, solar stocks look dreadful. Is this a buying opportunity?

Like many young and rapidly developing industry sectors, solar has been a victim of speculative excess and froth. Since 2008, both KWT and TAN have lost a breathtaking 90%.

Last July, the market value of SunEdison, a renewable energy company with a large solar footprint, was close to $10 billion even though the company had amassed long-term debt of around $9.8 billion. But financial markets became uneasy with SunEdison’s frantic pace of increasing its already heavy debt load by acquiring competitors. On April 21, the St. Louis area-based company filed for Chapter 11 bankruptcy protection listing $16.1 billion in debt.

The aftermath of SunEdison’s failure stung solar ETFs like KWT and TAN that had counted it as a top holding. Similarly, ETFs that invest across a broad array of alternative energy markets such as  biomass and wind power were also hurt.

Because SunEdison was viewed by many hedge fund managers and analysts as a “blue chip” company within the solar industry, its quick demise sent shockwaves throughout the market. It also dampened the appetite for leverage and risk within the sector.

Bright Spots

Among the bright spots within the solar market is the willingness of companies to acquire and be acquired. For instance, Tesla’s $2.6 billion deal to acquire SolarCity is a reminder that big deals can happen even when the industry is in chaos. Looking ahead, the SolarCity deal should trigger more merger activity inside the solar sector, which in turn will help companies to strengthen their businesses and balance sheets. 

Institutional support for solar power is another positive trend. 

Last year, the U.S. government authorized a five-year extension of the Investment Tax Credit for alternative energy companies. As a result, solar in the U.S. is expected to remain a double-digit gigawatts market annually through the end of this decade, according to the Solar Energy Industries Association (SEIA).

“While it took us 40 years to hit one million U.S. solar installations, we’re expected to hit two million within the next two years,” says Tom Kimbis, SEIA’s interim president. “The solar industry is growing at warp speed, driven by the fact that solar is one of the lowest-cost options for electricity and it’s being embraced by people who both care about the environment and want access to affordable and reliable electricity.”