Investors are always being told to diversify. Losses in one section of the portfolio can be overcome in other areas.

In Johnson & Johnson's (NYSE:JNJ) second-quarter earnings report, it gave an object lesson of the benefits of this principle.

The company reported a decline in revenue for two products: $100 million less of Procrit and almost another $50 million less of medical device Cypher. Yet it still grew total revenue by 9%.

Procrit, J&J's anemia drug, has been getting hammered by FDA panel after FDA panel, along with Amgen's (NASDAQ:AMGN) anemia franchise. Its drug-eluting stent, Cypher, has undergone a double whammy. First, the market shrank due to safety issues and then, just as it looked like procedures were turning around, Medtronic (NYSE:MDT) entered the U.S. market. Things aren't likely to get any easier, either, because Abbott Labs (NYSE:ABT) and Boston Scientific (NYSE:BSX) also got their new drug-eluting stents approved earlier this month.

But now comes the power of diversity. Drops in sales in some areas, while not fortuitous, can be offset by growth in other areas. Leading the pack was consumer sales of such item as Band-Aids and all those over-the-counter products it got from Pfizer (NYSE:PFE) back in 2006. Sales jumped 13% here, while medical devices were up 12% year over year. Pharmaceutical sales were up just 3%, dragged down by the aforementioned Procrit issues. Lower sales of its antipsychotic Risperdal also contributed, in anticipation of Teva Pharmaceuticals' (NASDAQ:TEVA) launch of its generic version of the drug.

Not only is Johnson & Johnson diversified in its products, it is also diversified geographically -- another lesson for investors. International sales jumped 16%. Now granted, just like last quarter, sales got a nice boost from the weak dollar, but even without the currency effect, international sales grew twice as quickly as those at home.

While the company certainly isn't in one of its high-growth spurts, diversification in this market is a lesson every investor should be heeding. And J&J's nice 2.7% dividend yield doesn't hurt, either.