Editor's note: A previous version of this article failed to state that Cubist Pharmaceuticals has an agreement in place with Teva Pharmaceutical for the generic version of Cubicin . After the drug loses exclusivity, Cubist will receive part of the gross profits from Teva's sales of the generic drug. The Fool regrets the error.

Shares of Cubist Pharmaceuticals (CBST.DL) exploded upward on Friday, finishing up over 9%. The company reported strong second-quarter results Thursday, beating average analyst estimates for both revenue and EPS. Total net revenues were $258.8 million, up 12.2% over Q2 2012, while non-GAAP diluted EPS was $0.42. Average analyst estimates were $254.73 million for revenue and EPS of $0.38.

Management highlighted strong growth in revenue (up 13.5% over Q2 2012  to $227.1 million) from Cubicin, the company's flagship product, which fights complicated bacterial infections such as MRSA. In Q1, Cubicin sales had fallen 9% compared to the previous year, so some of the jump should be attributed to this recovery.

Cubist also reported it has received fast-track status from the Food and Drug Administration for all three potential indications of its late-stage pipeline drug, ceftolozane/tazobactam (CXA-201), which targets serious Gram-negative bacterial infections. Shares are up more than 30% this year based on Friday's close, and investors looking for growth should be pleased with Cubist's top-line growth, especially the increase in Cubicin sales. However, the potential indications of CXA-201 are more important going forward, as the market turns its attention to Cubist's pipeline.

Diversifying revenue stream
There are several factors to consider in Cubist's long-term outlook. Multi-drug resistant "superbugs" represent a serious global threat. Look for future health care legislation similar to the 2012 Generating Antibiotic Incentives Now (GAIN) Act to encourage stronger investment in antibiotic R&D. The most significant threat in Cubist's future is the generic competition that Cubicin is expected to face in 2017. After the drug loses exclusivity, Teva Pharmaceutical will be able to manufacture a generic version of Cubicin, and will share some of the gross profits with Cubist. However, Cubicin accounted for around 90% of the company's 2012 revenue. If a long-term replacement can't be found, the company could be in trouble. Cubicin also faces competition from similar drugs such as Zyvox, marketed by Pfizer.

Cubist's late-stage pipeline is the key area to watch. Those events include the new drug application for CXA-201 -- which should follow results from the phase 3 trials that are expected in the second half of 2013 -- as well as phase 3 trial results for two other drugs, CB-315 and CB-5945. Analysts expect CXA-201 to be Cubist's next big blockbuster drug, so getting this drug through clinical trials and under FDA review is of paramount importance.

Long term, Cubist needs to diversify its revenue streams. If it can't, bacteria will be the least of its worries.