It was just last summer that SunEdison was a Wall Street darling, the very air around the fast-growing company seeming to shimmer with potential.

SunEdison was, after all, a red-hot company in a red-hot space — renewable energy. Its market capitalization reached nearly $10 billion, putting it on a par with the likes of Wynn Resorts of Las Vegas. Among the believers betting on its stock was the hedge-fund heavyweight David Einhorn of Greenlight Capital. With plans to buy Vivint Solar for $2.2 billion, SunEdison appeared unstoppable.

And then the company went supernova. Its shares fell from around $32 last summer to 34 cents this week. Mr. Einhorn furiously tried to dump his stake in recent weeks. In early March, Vivint said, “thanks, but no thanks” and exited the deal with SunEdison.

On Thursday, to the surprise of no one, SunEdison filed for bankruptcy — one of the largest in a series of recent green-energy failures.