Electrons as Standing Waves
Electrons act as both particles and waves, so can be modelled in an atom as being standing waves. Their De Broglie wavelength is equal to h/p, where h is planck's constant, and p is the momentum. In order to picture this, it has to be thought of as the electron being in a box.
The first energy level is where the length of the box is half the wavelength of the electron. This is where the energy is the lowest. Moving further away from the nucleus there are increasing energy levels, and different harmonics are set up.
A harmonic is a multiple of the fundamental wave. These can only occur at energy levels that allow a complete standing wave to form. If this is not the case, energy will be lost as the electron orbits the atom, therefore causing it to spiral in to the nucleus.
The most electrons will be found at the antinodes.
E(n) = -13.6eV/n^2. This is the calculation for the energy of an energy level (n) in a hydrogen atom.
Each energy level corresponds to a discrete frequency. This gives the proof to show that there are discrete energy levels for the atom.
Electrons and Spectra
The actual shape of the relationship between the distance away from the nucleus and the energy of it's energy level is 1/r. The box model is used to simplify this.
In general, E(n) = n^2 E(1)
Where E(1) = n^2/2mv^2
This shows that the closer to the nucleus the electron is, the lower the energy that it has.
Each atom can produce an atomic emission spectrum. This is because, when the electrons drop down energy levels, they emit a photon, where the lower energies correspond to long wavelengths and therefore the blue end of the spectra, and vice versa for red wavelengths.
Different elements will have different energy levels and therefore produce a range of different wavelengths of light. This accounts for the difference in their emission spectra.