Light-Emitting Diodes (LEDs) - What Do They Do?
In a diode formed from a direct band-gap semiconductor, such as gallium arsenide, charge carriers that cross the junction emit photons when they recombine with the majority carrier on the other side. Depending on the material, wavelengths (or colors) from the infrared to the near ultraviolet may be produced. The first LEDs were red and yellow, and higher-frequency diodes have been developed over time. All LEDs produce incoherent, narrow-spectrum light; "white" LEDs are actually a blue LED with a yellow scintillator coating, or combinations of three LEDs of a different color. LEDs can also be used as low-efficiency photodiodes in signal applications. An LED may be paired with a photodiode or phototransistor in the same package, to form an opto-isolator.
Reference: Wikipedia