|MadSci Network: Physics|
The reason is exactly what you said. Particle physicists typically speak of a particle's "Mean Free Path." Since the electrons in your TV tube are travelling at about 185 million miles per hour, if they run into a gas molecule, they're going to have a horrible collision. The mean free path is the average distance an electron can travel before it hits something. In the case of a good TV tube, the mean free path would be in the neighborhood of 10 meters, so most electrons won't hit anything. Atmospheric pressure is 760mmHg at sea level, and at that pressure, the mean free path is very very small- maybe 10 - 100 angstroms (1 x 10-8 meters!). As you go up, the pressure decreases, and the mean free path increases, until you are in the far reaches of the upper atmosphere. There, the pressure approaches that of a Neon sign tube, or a light bulb. In outer space, the pressure is nearly that of the inside of the vaccum tube in your TV.
When an energetic electron strikes a gas molecule, it gives up some of its energy to the electrons orbiting the nuclei of the gas molecule. In the simplistic Bohr model, the electrons are "knocked" into higher orbits. In the Bohr model, the higher the orbit, the more kinetic energy the electron has. The atomic electrons then "fall" back to their rest orbits, losing the energy difference between the higher and the lower levels. This energy loss is radiated in the form of visible light.
It turns out that this is exactly the mechanism that makes Neon lights and (though a bit more complicated) fluorescent lights work. There isn't very much gas inside the Neon sign tube, so the electrons can speed up. When an electron hits the gas, the atomic electrons are excited. For a variety of complicated reasons, the electrons want to be excited to certain levels, and fall back to their original positions. Each level has a particular energy associated with it. Since the frequenct of the light given off (or the color as we percieve it) is directly proportional to the difference in energy level, only a certain set of colors is given off for a particular gas. That is why there are certain spectra associated with certain gasses. For example, Neon gives off red-orange light, Mercury gives off blue light, and so on.
As I mentioned before, the upper atmosphere is more or less like the inside of a Neon sign tube. So whenever the solar wind kicks up (a stream of high energy electrons and other particles), lots of the particles hit the gas molecules. If the solar wind particles are energetic enough, they will excite electrons of the gas, and the gas will glow. This is what causes the aurora seen in the North in the night sky!
Hope this answers your question!
Try the links in the MadSci Library for more information on Physics.