Shares of First Solar plunged on Friday after the seller of solar power systems reported a surprise loss for the second quarter as revenues badly missed expectations.

The stock price fell by about $5 per share, or more than 9 percent, dropping below $49.

First Solar posted a loss of 46 cents a share for the quarter, compared with estimates for a profit of 2 cents in a Thomson Reuters survey of analysts.

Sales for the quarter totaled $308 million, well below Wall Street's expectation for sales of $503 million and less than half what First Solar drummed up in the year-ago period.

First Solar pinned the revenue whiff on lower-than-anticipated sales of its solar power systems and modules. Some of those sales have been pushed off to the second half of the year, the company said.

The company also narrowed its sales guidance for 2018. It now sees revenues of $2.5 billion to $2.6 billion, compared with an earlier forecast for $2.45 billion to $2.65 billion.

Analysts also pointed to a decline in First Solar's gross margin. Due to the cost of producing its new Series 6 solar module, the company knocked down its full-year estimate for gross margins to 20.5-21.5 percent from an earlier projection of 21.5-22.5 percent.

"The main culprit, however, was gross margin: at (2.6)%, it was – remarkably (and not in a good way) – the first quarter in negative territory since First Solar's IPO all the way back in 2006," Raymond James analyst Pavel Molchanov wrote in a research report.

"To be sure, it had been disclosed in April that Series 6 startup complications would weigh on the near-term picture – though not to this extent."