LOS ANGELES - First Solar Inc's shares surged nearly 5 percent on Friday, buoyed by news the U.S. solar power company will join the flagship S&P 500 stock index and after it landed a buyer for a 20-megawatt solar power project in Canada.

First Solar's rally outperformed the S&P 500, which was down about half a percent and other solar stocks. U.S.-based SunPower Corp and China's Suntech Power Holdings Co Ltd both fell about 2 percent in midday trading on Friday on the Nasdaq and New York Stock Exchange, respectively.

The shares of companies joining the S&P 500 often rise because many portfolio managers try to track the index.

It helps us out one time, but it doesn't help us out in terms of the overall performance of the company, said Mark Bachman, an analyst with Pacific Crest Securities.

Investor enthusiasm for First Solar also brightened on news the Tempe, Arizona-based company will sell its 20 megawatt solar project near Sarnia, Ontario to pipeline operator and natural gas distributor Enbridge Inc.

They will get a bump up in fourth quarter revenues because of it, Bachman said.

Piper Jaffray analyst Jesse Pichel said it had been expected that First Solar would join the S&P index for some time.

Given its poster boy status, it means First Solar will have to step it up with respect to providing a more clear message on its conference call and clearer guidance, Pichel said in an email.

Pichel, who has an outperform rating on First Solar, warned the company could be the most volatile S&P index company and leave a bad reputation for renewable companies if the company doesn't defend itself against analysts who cater to short sellers.

We think analysts underestimate growth and overestimate potential pricing headwinds, Pichel added.

The company's shares were $6.67 higher at $150.43 in midday trading on the Nasdaq.

(Reporting by Laura Isensee; editing by Andre Grenon)