Shouldn't air be opaque since instead of coming into our eye, the lightwaves get caught in the electrons? If oxygen does absorb light waves, how come air is not hot and you can see through it? The way I understand it is when electrons take in energy in the form of light, they jump to a higher electron shell and that light is no longer light, but energy.
The most direct answer I found is that N2 and O2 are very simple molecules. 2 atoms, tightly bound, no angles.
Because the nitrogen gas molecule is so simple, it cannot do very much with the light energy that it absorbs. It can spin or vibrate only a little bit by stretching and pulling. Oxygen acts pretty much the same way.
Because of their structural simplicity, nitrogen and oxygen, which together make up 99 percent of the earth’s atmosphere, absorb relatively small amounts of the visible light energy coming from the sun that passes through the air. This leaves the “glass” of the earth’s greenhouse pretty clear.
Water vapor, however, is a different story. Water (H2O) has two hydrogen atoms bonded to a single oxygen atom. The oxygen atoms are bent to form a 105-degree angle.
The water molecule can twist, turn, gyrate, bend, flex, and do its own little chemical dance.
If the photon has enough energy, like some short wavelength UV light, it can split an O2 (or split an N2 with even more energy), but visible light doesn't have enough energy.
Absorption is the process by which radiant energy is transferred to matter. If the matter is a gas, radiation can effect it in a number of ways. The ways it can absorb energy depends on the size and complexity of the gas molecule. The gas molecule can be rotated and a variety of vibratory modes can be excited depending on the nature of the molecule. If the energy is strong enough the molecule can be broken apart. Each mode of energy absorption occurs at a specific narrow band of the solar spectrum. Gases, therefore, are not like black bodies that absorb equally and completely at all wavelengths. Rather, they absorb only at specific, often narrow ranges of wavelengths. Diatomic molecules such as nitrogen and oxygen (most of our atmosphere) can absorb energy by increasing the vibration of the bond between the two atoms. If the energy absorbed is great enough it may break the bond resulting in two free wheeling oxygen or nitrogen atoms traveling at high speeds.
O2 + ultraviolet light = O + O
This occurs in the uppermost regions of the atmosphere, above one hundred kilometers (refer to figure 8). The most energetic (shortest wavelength) part of the solar spectrum is involved in this process. Nitrogen absorbs only in the extreme ultraviolet of which there is very little in the Sun's radiation. Oxygen absorbs more strongly than nitrogen and over a wider range of wavelengths in the ultraviolet.
Quantum mechanics says that only very specific wavelengths are acceptable for exciting an atom, wavelengths that are not those (most of the spectrum) passes by the atom without interacting much (just some scattering in the case of visible light).
The allowed wavelengths are the ones that have energy extremely close to the energy difference between two allowed orbits.
Oxygen and Nitrogen do absorb 'light' but only in the ultra-violet region of the spectrum below approx 200nm, an area invisible to our eyes but easily observed by photomultipliers and similar detectors. This absorption is caused when an electron from a molecule's ground state is promoted to one of several electronically excited states. These states have such a high energy that they only absorb in the uv. Bromine and chlorine for example are brown and green gases respectively as they have lower excited state energies. The energy of electronic states is determined by the details of the electronic make up of the molecules and is different for each diatomic. (Which states are 'coupled' by the radiation depends on 'selection rules' which are determined by conservation of energy and angular momentum)
Molecules also have vibrational and rotational energy levels but homonuclear diatomic molecules have no permanent or induced dipole (as a result of vibrations) which is why they do not absorb lower energy photons (such as visible (400-650 nm) or infrared > 1000nm. (Classically, the electric field of the radiation interacts with an oscillating dipole of the correct frequency, no oscillating dipole, no interaction, no absorption).
Incidentally, the presence of a dipole is why CO2 acts as a greenhouse gas because, although linear (O=C=O) with no permanent dipole it has a vibrationally induced dipole (O---C=O <-> (O=C---O) and so absorbs infra-red light.