Why x-ray are stopped by atmosphere while they are more energetic than UV or IR?
They certainly interact with atmosphere but I can't understand which phenomenon stop them.
The Chandra web site has a nice description of this. see http://chandra.harvard.edu/xray_astro/absorption.html for the details. In brief, X-Rays have enough energy to ionise molecules in the atmosphere and they are absorbed in the process.
X rays have a short wavelength. Imagine a road covered with pingpong balls. Try to roll a marble across, and it will most probably bounce back and forth amongst the balls, and eventually stop without getting to the other side. Now try a soccer ball. These will cross almost all the time. And now a truck. I doubt that you will find a situation where these don't cross..
Similarly, the atmosphere can be thought as the road with ping pong balls(molecules), and EM waves are various objects you try to roll. Radio waves have large (1 meter &c) wavelengths. Nobody stops these. Light waves have much smaller wavelengths (in $\mu\text{ m}$), but those are still large as compares to atoms (these are to the order $10^{-10}\text{ m}$). X rays are small enough to be obstructed by everyone, thus (thankfully) they do not reach the crust and fry us.
An interesting side note: The reason that makes radio waves abundant is the same reason why they are harder to use than light/xrays in astronomy. Because of their size, they do not give an accurate reading unless we employ large telescopes. Think back to the truck. If an ant hypothetically throws a truck at you, you really can't be sure where the ant is. But if the ant throws a marble or a sesame seed (assuming you catch the seed and determine its velocity), you can calculate the trajectory and find the ant with accuracy, and squash him for throwing things at you. The same principle applies when searching for a radio source..
I would think the simple explanation would go like this. If an X -ray photon travels along a path between air molecules (no molecules along the path/ all molecules are to the side of the path) - then the photon isn't absorbed. If the photon is not on a molecule-free path and it hits a molecule, it is absorbed. A column of 14.7 pounds of air sits on every square inch of the earth's surface. There are no "molecule-free paths" from the "top of the atmosphere" to the ground when say a beam of X-Rays with cross section 1 square inch tries to travel from space, through 14.7 pounds of air, to the ground, so it is all absorbed. In the hospital, when you have an x-ray image made, a beam of X-rays with cross-section of 1 sq inch would only have to travel through something like 10 grams of air from the source to your body, then go through one pound of your muscle, and then a few more grams of air to reach the plate. Lots of photons are absorbed, but percent-wise many more make the trip than through 14.7 pounds of air. Bones are another matter - the atoms are so close together that there is no atom-free path even through a small bone (depends a bit on bone density though).
After interaction with matter x-rays usually degrade to less energetic forms of EM radiation - below the x-ray range - while less energetic photons tend to be absorbed and re-emitted within the same range as the incident radiation - as it happens with photons in the visible-light-range or IR-range.
The fact that Earth's atmosphere is very large [ equivalent tp "5 meter (16 ft) thick wall of concrete!" according to "https://chandra.harvard.edu/xray_astro/absorption.html" ] is what makes it very effective to block x-rays.
Photons with long wavelengths tend to "behave" more like "waves" [bounce, reflect, scatter, etc.] and the short wavelength ones more like "particles" [either they are "absorbed" or they just pass through - the wave nature is more disguised] and waves tend to propagate to longer distances than particles, generally speaking.