The molecule interacts with the oscillating electric part of electromagnetic radiation. It goes to a higher energy level.
Molecules have quantized rotational, vibrational, and electronic energy states. The energy difference between two states is
ΔE = E₂ - E₁ = hν. If the frequency of the radiation equals ν, the molecule will absorb the energy and go to the higher state.
Depending on the energy, the molecule will go to a different rotational state. It may assume a different type of vibration. Electrons may jump to higher-energy orbitals or even leave the molecule.