2015 was almost a great year for Vivint Solar, Inc. (NYSE:VSLR). The company agreed to a $2.2 billion buyout from SunEdison (NASDAQOTH:SUNEQ) in July, and the stock cruised to a 72% gain, only to fall to just a small gain by the end of the year. A few major things went wrong in 2015, but here are the worst headlines for Vivint Solar.

Sales costs are rising
One of the surprising narratives for residential solar companies in 2015 was that it's becoming harder to sell solar power systems. Companies like Vivint Solar have put so much effort into growth, but they've found that every incremental sale becomes more and more expensive.

That trend manifested in the third quarter when Vivint Solar said sales and marketing costs rose to $0.59 per watt, up from just $0.28 per watt a year ago. That's a shocking rise, and it calls into question how much the company can grow in the future.

Maybe it was the rising sales costs and increased competition for the customers who are left that made Vivint Solar desire a buyout so desperately (which I'll get to below).

SunEdison collapses
After SunEdison offered to buy Vivint Solar, the market rejected the deal almost immediately. SunEdison and its yieldcos started to fall by the end of July, and soon after, the house of cards that had built the company into the largest renewable energy developer in the world began to crumble.

SunEdison had hoped to use its yieldcos like an MLP -- to collect assets and generate yield -- which would flow to the parent company as the yieldcos grew. But yieldco investors also want consistent cash flows, and they're not certain that residential solar customers provide that. Maybe that was just an excuse to start the sell-off, but once it started, there was nothing to stop it, leaving us where we stand today -- with SunEdison trading at around $5 per share, off its 52-week high of $33.45.

Accepting less to complete buyout
The problem for Vivint Solar is that the $16.50 per-share buyout consisted of $3.31 per share in SunEdison stock, and $3.30 per share in SunEdison convertible notes. The falling stock price meant the buyout was worth less even without renegotiation, and that the buyout was less likely to happen at all given SunEdison's debt load. So Vivint Solar renegotiated, taking $2.00 per share less in cash, and getting $0.75 more in SunEdison stock -- which didn't offset the losses already incurred in the stock -- and a deal looks likely to be completed.

Maybe Vivint Solar could have walked away, but management might have seen increased competition from SolarCity and rising sales costs, and decided to take the money and run. Maybe there's weakness in the business that we don't know about yet. But it's disappointing for investors that a buyout that was once valued at $2.2 billion will now be significantly less than that.

Travis Hoium has no position in any stocks mentioned. The Motley Fool owns shares of and recommends SolarCity. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.