It looks like Pfizer's (NYSE: PFE) Viagra won't have any little blue generic competition for a while. During a court case with Teva Pharmaceutical (Nasdaq: TEVA), Pfizer successfully defended its patent to keep generic competition at bay until October 2019.

The composition of matter patent on Viagra's active ingredient expires next year, but the pharma giant applied for a method of use patent to cover using the drug to treat erectile dysfunction. That type of patent is often hard to defend because generic-drug makers are able to argue that testing the drug for that type of use was obvious, and obvious ideas aren't patentable.

But using Viagra as an erectile dysfunction drug wasn't so obvious. The drug was originally developed as Revatio for high blood pressure, but Pfizer realized that it also helped with erectile dysfunction.

With sales of about $1 billion in the U.S., this is a big win even for a company the size of Pfizer. Including an additional billion in international sales, Viagra makes up about 3% of Pfizer's current revenue. With the loss of Lipitor, revenue is headed lower. Viagra is likely one of Pfizer's higher-margin products, so the contribution to the bottom line is even more substantial.

Ironically, Viagra's competition in the erectile dysfunction space -- Eli Lilly's (NYSE: LLY) Cialis and Bayer and GlaxoSmithKline's (NYSE: GSK) Levitra -- will also benefit from Pfizer fighting off the generic competition. Patients often switch medication when cheap generics become available. Pfizer's Lipitor saw that happen when Merck's (NYSE: MRK) Zocor went generic.

The biggest beneficiary could be VIVUS (Nasdaq: VVUS), which has a new erectile dysfunction drug currently under review by the FDA. It's going to be hard enough competing with the big boys; launching against a cheap generic would have made things extremely difficult.

Keep it up, Pfizer. Keep it up.