Original: This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor.
Simplified: This effect is a form of electroluminescence.