Matter emits light for several reasons:
1) When an electron surrounding a nucleus goes from one state to another at a lower energy, the most efficient way for energy to be conserved is for the atom to emit a photon -- ie, light. This is why a neon light gives off red light.
2) When electrons are actively vibrating due to the motions of the atoms they are connected to, Maxwell's Laws show that they will give off EM vibrations -- ie, light. This is why a fire is bright.
3) When free electrons are rapidly buzzing around, interacting with other charged particles, their accelerations due to these interactions also result in EM vibrations. This is one reason our Sun is glowing.