What happened 

Shares of thin-film solar panel manufacturer First Solar (FSLR 0.71%) rose as much as 15.4% in trading on Friday after reporting second-quarter 2022 financial results. Shares closed the day up 12.1%. 

So what 

Revenue fell 1% to $621.0 million, and net income fell from $82.4 million a year ago to $55.8 million, or $0.52 per share. Results don't seem good on the surface, but analysts were only expecting revenue of $607 million and a loss of $0.44 per share.

Results did include a $245 million pre-tax gain on the sale of a Japanese project development and operating and maintenance platform. But management does expect the year to be better than previously expected, increasing sales guidance by over $150 million to $2.55 billion to $2.8 billion. 

Now what 

First Solar continues to perform well at a time when raw material costs are pressuring margins. But management has been able to adjust future contracts to include adjustments for higher energy and raw material costs, so margins should improve. 

Construction continues for new manufacturing facilities in the U.S. and India, which are helping the stock today. It was only yesterday that the Senate announced an agreement on increased subsidies for U.S. solar manufacturing and installation. First Solar should be one of the biggest beneficiaries of that bill, and that'll be a huge tailwind for the business long-term.