Cree (NASDAQ:CREE) shareholders have had a rough ride during the past nine months or so, although long-term investors should be used to it by now. Cree is a habitual underperformer that has been pummeled by strong competition for its light-emitting diodes, or LEDs. Nevertheless, I think the stars may finally be aligning for this company.

The ABCs of LEDs
LEDs are semiconductor devices that emit light when energized by an electric current and are used frequently in backlighting of handheld devices, and in camera flashes, automotive tail lights, and street lamps. Manufacturers of LEDs are in a constant struggle to increase both the brightness and the efficiency, to expand the range of applications in which LEDs can be used.

Cree fabricates the substrate (essentially the base) of its LEDs from silicon carbide and the light-emitting portion from gallium nitride. Because of its extensive knowledge of both gallium nitride and silicon carbide, Cree is also expanding its products to other areas -- more on this later.

LEDs are gradually replacing other types of lighting in certain applications as their prices come down. Compared with incandescent and fluorescent lighting, they consume less power, generate less heat, and have longer lifetimes. They give you an advantage when power consumption is an issue, as with handheld devices, and the long lifetime makes them attractive when it's expensive to send someone out to replace a burned-out light -- street lights are an example.

Cree's LED products can be sliced and diced a couple of ways. It sells both mid-brightness and high-brightness variants, with the high-brightness products being most important to its future. The bulk of Cree's LEDs are sold as unpackaged chips (like its EZBright chips), and it's left to the customers to package them appropriately for the intended application, but it also sells them fully packaged (as with the XLamp line).

Power products
Cree has been beating the silicon-carbide and gallium-nitride drums for years now, but there is finally evidence that its efforts are paying off in the marketplace. For example, it sells silicon carbide-based Schottky diodes, which are used in power supplies. Cree's Schottky diodes can be used at higher voltages and operate at faster speeds than the silicon-based counterparts from other companies.

There is also a line of radio frequency (RF) transistors that show promise for broadband wireless applications. If WiMAX, which Intel (NASDAQ:INTC) is pushing, is a success, Cree may be one of the beneficiaries. Transistors based on silicon carbide or gallium nitride can be physically smaller while delivering performance equivalent to the gallium arsenide RF products from companies like Anadigics (NASDAQ:ANAD) and RF Micro Devices (NASDAQ:RFMD).

There is competition in the high-power product lines, but there are many fewer competitors than in the LED markets. For example, Infineon (NYSE:IFX) manufactures competing silicon carbide power products, but this hasn't prevented Cree's revenues from growing rapidly. During the most recently completed quarter, revenue from the high power products increased by 75% year over year to $5.3 million (about 6% of total revenue).

What went wrong?
Given that the markets for LEDs should grow strongly and Cree's high-power products are growing well now, you can't be blamed for wondering why the stock is hovering near a 52-week low. The company's difficulties can be summarized in one word -- competition.

Cree's financials started to show some strain in 2006, but during its most recently completed quarter, Q2 2007, the stinky stuff really hit the fan. LED revenue dropped 24% from the previous year, even though total units shipped increased by 5%. Unsurprisingly, the performance was worst among the mid-brightness LED products. Gross margins took a big whack during the quarter, falling all the way to 34% after averaging 47.5% during fiscal 2006. The earnings engine last quarter wasn't the business, but the sale of Color Kinetics (NASDAQ:CLRK) shares.

The problem is that Asian-based competitors have thrown up manufacturing facilities and are churning out inexpensive LEDs at a frenetic pace. They have been aggressive in winning business for backlighting in mobile devices, resulting in rapidly declining selling prices.

Why will Cree turn around?
Falling sales and collapsing margins don't normally warm investors' spirits, but there are several reasons that I believe Cree will do better.

First, the LED market is in between growth spurts. The growth of LEDs used in backlighting for mobile phones and other handheld devices has slowed, but other markets with multi-billion dollar potential haven't yet taken the growth baton. These markets include backlighting of large LCD screens, ambient lighting, and automotive headlamps. In these applications, high brightness, uniformity, long lifetime, and color stability (yeah, the color of these things can drift as it warms up) are more important than in current applications and may pressure some of the competition's technology.

One factor that may drive faster-than-expected adoption of LEDs for ambient lighting is high energy prices. About 20% of our nation's electricity consumption is lighting. If energy prices remain elevated, or go higher, people may sour toward paying the electricity bill for incandescent lighting -- and LEDs would stand to benefit. In fact, there are rumblings that the European Union may ban incandescent bulbs within two years.

Competition, especially in the LED markets, is a significant risk factor. Cree has been hurt by competition in the mid-brightness markets and may buckle under competitive pressures in the high-brightness markets also, although I am hopeful its technology will provide a durable edge. There are also red flags waving on the balance sheet -- rapidly increasing inventory and accounts receivable. For these reasons, I don't expect great results right away, and it's possible that the stock could drop meaningfully from its current levels.

Cree is not a stock to buy and forget, due to the risks mentioned above -- definitely perform due diligence before investing. Nevertheless, for investors who can tolerate some volatility, I believe that the possible rewards offset the risks. It looks to me like the strengthening demand picture for LED lighting, combined with the boost from the high-power products, will send Cree shares higher over the next couple of years.

For related Foolishness:

Intel is an Inside Value recommendation. What is Wall Street overlooking now? Inside Value gives subscribers the big names with the best prospects for good returns. A free trial gives you all the picks and how they're doing.

Fool contributor Dan Bloom owns shares in Anadigics and Intel. He welcomes your comments. The Motley Fool has a disclosure policy.