An atom can be excited either by
  1. a collision with another particle (an electron, atom, molecule, etc.)
  2. absorption of a photon exactly matching the energy difference between two states.