SunPower pulled itself out of a net loss and boosted its revenue by 39 percent for the second quarter, the company said Thursday.

The San Jose, Calif.-based company, which makes solar panels and builds solar power projects, reported $298 million in revenue, compared with $214 million for the first quarter. SunPower posted a net income of $24.17 million for the second quarter, or $0.26 per share, compared with a net loss of $4.79 million, or $0.06 per share, in the first quarter.

The second-quarter earnings included a one-time gain of $21.2 million, or $0.21 per share, from its securities offering and a one-time charge of $5.9 million, or $0.04, that went into effect following new accounting rules.

The second-quarter numbers still pale to those generated by the company in the year-ago period. SunPower took in $383 million in sales and $31.16 million in net income, or $0.37 per share from the second quarter of 2008.

SunPower CEO Tom Werner sounded much more cheerful this time than a few months ago, when he announced a lackluster first-quarter results and called it "the most challenging quarter since we went public in 2005." Back then, the company announced cost-cutting measures that included the delay of using newly completed production lines (see SunPower Posts Q1 Net Loss, Delays Factory Plans).

The mood has changed. 

"We beat our goal in the second quarter, and our team performed very well," Werner said during a conference call with equity analysts.

SunPower's Class B shares rose about 19 percent to reach $25.62 per share in after-market trading. It's Class A shares increased by nearly 19 percent to reach $29.50 per share.

The company was running its factories at below 50 percent during the second quarter, but the utilization rates are "creeping up based on the demand we have seen," said Dennis Arriola, SunPower's chief financial officer. 

SunPower executives said the company did well in the residential and light commercial market, particularly in California, the country's largest solar energy market, Werner said.

The company also launched what Werner said was the "first comprehensive solar brand building and lead generation advertising campaign in North America" during the second quarter. The campaign included radio spots and ads at public transit stations.

SunPower recently lined up $100 million from Wells Fargo to support projects where SunPower customers would get solar electricity via long-term contracts without having to own and operate the systems (see Wells Fargo Plans for $100M Solar Financing).

During the second quarter, SunPower installed 25 megawatts as part of its contract with the Florida Power and Light. SunPower plans to install 10 megawatts more at the Kennedy Space Center by the end of the year (see SunPower Plans 35MW Plants in Florida).

The company has 1.3 gigawatts of projects under development in the United States, Werner said.

Werner also touted a new product SunPower launched in May that integrate the panel with a mounting system. Called T5 Solar Roof Tile, the system is designed to lower installation costs by eliminating the need to place panels on the racks at the job sites. It also requires no roof penetration, and is meant for flat or low-sloped commercial rooftops. Other companies, such as Akeena Solar, also have designed systems that would come pre-assembled with solar panels, racks and other components in order to shorten installation time. 

The company has revised its forecast for 2009. It now expects to generate between $1.35 billion and $1.7 billion, instead of the previous guidance of $1.3 billion to $1.7 billion. Earnings should reach $0.45 to $0.90 per share, which would include one-time gain from the equity offering and other charges.

SunPower expects to produce about 400 megawatts for 2009.

By the end of this year, SunPower expects to be able to produce its panels at less than $2 per watt, Werner said. The cost would fall to less than $1 per watt by the fourth quarter of 2014.

The company's currently ships solar cells with 22.5 percent efficiency, and it plans to boost that to 25 percent by the end of 2014.