A LED is a pn junction diode that is capable of emitting light. An LED operates just like a regular pn junction diode. Diodes must be forward biased for current construction.
What differentiates an LED from a regular diode is the semiconductor material used to form the pn junction – regular diodes are made of semiconductor materials like Silicon or Germanium; whereas LEDs are made of materials like GaAs compounds and InP compounds.
In a regular diode, when current flows, energy is thrown off in the form of heat. In a light emitting diode, an electric current passing through the diode causes light in the visible portion of the electromagnetic spectrum to be emitted. This phenomenon is called electroluminescence and is responsible for the emission of incoherent light from the semiconductor material.
LEDs can emit light of different colors. In fact, the radiation emitted may not be in the visible region at all! LEDs can emit light in the Infrared and Ultraviolet region too. The color of the light emitted depends on the semiconductor used to fabricate the pn junction in the diode. For example, GaAsP is used to make LEDs that emit red light and InGaN for blue LEDs.
You must have seen several electrical devices that use LEDs. Using LEDs for providing visual indication in displays is very common. Some times several LEDs are packaged together to form numeric displays. Such displays are called seven segment displays. You may have seen these displays on your microwave or washing machine for setting timers.
LEDs emit a narrow beam of light and require additional focusing optical devices to generate a desired radiation pattern. As LEDs of higher power are developed and optics for LEDs evolves, LEDs are being used incrementally to replace incandescent lamps and area lighting. They are used for UV-based water purification also.