What happened 

Shares of solar energy stock SunPower (SPWR -4.84%) fell as much as 11.8% in trading on Wednesday after reporting second-quarter 2021 financial results. At 3:20 p.m. EDT, shares were down still 9.1% and don't look like they'll get much of a bounce today. 

So what

SunPower's revenue was up 41.9% in the quarter to $308.9 million, and net income from continuing operations jumped from $55.9 million to $75.2 million, or $0.40 per share. That number includes an $84 million mark-to-market gain on equity investments, so if you pull that and other one-time items out, earnings were just $0.06 per share.

A large roof with solar panels installed.

Image source: Getty Images.

Analysts were expecting revenue of $327.3 million and earnings of $0.04 per share, so there was a top-line miss, even though the adjusted earnings-per-share number did beat estimates. 

Investors may have been expecting more after blowout results from solar equipment suppliers Enphase Energy and SolarEdge. That's part of the reason results looked weak compared to these companies, despite the improving top and bottom line. 

Now what

Results may have fallen below expectations, but there was a lot to like from SunPower last quarter. Gross margin jumped from 11.8% a year ago to 19.8%, including a 22.5% gross margin from residential sales.

The company continued to pay off debt, too, ending the quarter with just $283 million of net recourse debt. Management also said they're expecting $1.41 billion to $1.49 billion in revenue and $40 million to $60 million in net income this year, with growth expected to continue next year.

Investors may not have liked the results short term, but SunPower continues to grow, improve margins, and expand its addressable market. Those are positive trends, and with debt now at a manageable level, this is a stock I'll hold onto long term.