An electron (blue) is excited to a higher energy state by absorbing a photon (green), and a photon is released (emitted) when electron drops to a lower energy level. The same amount of energy difference ΔE = hv is involved in either transition. The nucleus (red) is positively charged.
This image is oversimplified for the purpose of illustration only. Electrons do not more on circular orbits, but on complex orbitals.