Istock

SunPower (SPWR - Get Report) shares brightened investors' day, leaping more than a third as the solar-energy-equipment provider swung to a second-quarter profit from a year-earlier loss on slightly lower revenue.

The shares were trading up 35% at $15.77.

The San Jose-based company earned 75 cents a share in the quarter, compared with a year-earlier loss of $3.17 a share. On an adjusted basis, SunPower reported its second-quarter loss widened to 22 cents a share from 1 cent a share.

Shares outstanding climbed 18% to 166.8 million.

Revenue slipped 2.9% to $436.3 million. The latest adjusted revenue was $481.9 million.

Analysts surveyed by FactSet were estimating a loss of 19 cents a share on revenue of $439.6 million.

Deployments advanced 30% in North American residences and 50% in businesses, both from the first quarter, SunPower said in a statement.

Megawatts deployed jumped to 622, up 37% sequentially from the first quarter and up 62% from the year-earlier second period.

For the full year, SunPower expects a bottom-line result ranging from break-even to a loss of $20 million. Revenue should come in between $1.8 billion and $2 billion.

Analysts are calling for a 2019 loss of 43 cents a share on sales of $1.97 billion.

Save 76% with our Summer Break Sale. Subscribe to our premium site Real Money and become a smarter investor! Click here today to sign up!