|MadSci Network: Astronomy|
X-rays from outer space can and do enter our atmosphere but they do not make it all the way to the ground. In fact they do not typically make it more than a kilometer or so into the atmosphere before they are stopped.
What stops them? Well, molecules in the atmosphere (particularly nitrogen and oxygen) can absorb x-rays. Atoms and molecules can absorb any kind of light (x-rays, gamma-rays, visible light, infrared light, radio light, etc.). What most often happens when an atom absorbs light is that the electrons in the atom take the light's energy and become excited (that is to say they take on higher energy than they already had). Light that has low energy can only excite electrons to very specific energies within the atom. This means that only visible light of very specific energies can be absorbed by any given atom or molecule. If you shine visible light through a gas like our atmosphere the light can go very far without being absorbed. In a gas there are fewer atoms in any given volume that can absorb the light than in a solid (we say the density of gas is less than solids). So the probability of a ray of visible light penetrating far into a gas before being absorbed is high. X-rays however have such high energies that they can give enough energy to electrons to break them free from their atoms or molecules (a process called ionization). Any atom or molecule could be ionized and therefore absorb any x-ray that passes through it. Thus it's actually easier for gas like our atmosphere to stop x-rays than visible light.
Now, I'm sure you are saying to yourself that it doesn't make sense that X-rays couldn't make it through a gaseous atmosphere when they can penetrate solid human bodies (like when the doctors pass x-rays through your body to make a picture of your innards). But remember that your body is not very thick (it's only around 1 ft or less thick). If you lined up a hundred humans and tried to pass x-rays through them, the x-rays wouldn't make it all the way through them either. The more atoms that the x-rays have to pass through the more likely it is that they will be absorbed. In the atmosphere, x-rays can make it down only a short distance before they have encountered so many atoms and molecules that they are all absorbed.
To sum up: X-rays have such high energy that they can ionize electrons from atoms and molecules. This means that they can get used up very fast when they are passing through matter. So when they enter our atmosphere they are absorbed very quickly and none make it to the surface.
I hope that helps. If any of this was confusing or you didn't understand the terminology I used please feel free to write me.
Try the links in the MadSci Library for more information on Astronomy.