Photons interact with matter if the matter offers quantum transitions that match, or nearly match, the photon's energy in the inertial frame of the matter. Ordinary matter such as wood, stone, etc. offers several groups of possible quantum transitions.
- Rotation of molecules (if they are free to rotate, i.e., not condensed matter)
- Vibration of molecules - bending, quivering actions
- Electronic excitations
- Nuclear excitations (there being various kinds, ignored here for simplicity)
Microwaves have such low energy they can't do much, though they might excite some types of vibrations on larger floppier molecules - however, any type of molecule that could be described as "floppy" probably isn't good for construction materials. Rotational modes aren't possible in a strong material made of crosslinked polymers or silicates. So microwaves mostly fly right through.
Near-infrared and visible light can kick electrons into higher molecular orbitals. Even if the energies aren't a match, just close, there is interaction, as Heisenberg lets them cheat temporarily. Also, having more energy, visible light photons can stir up a greater variety of vibrational modes. There's nothing in common wall materials to prevent that, and in fact, the interaction with photons is so strong that the material, if not super-thin (microns), will be opaque. Of course, glass is an exception.
Gamma rays are of such high frequency, electrons (or ions, or polarized ends of molecules) can't keep up due to inertia - so no interaction, or only a little. At the right frequencies, gamma photons can interact with nuclei, but for a randomly chosen source of gammas, its photons are unlikely to match closely enough with any of the available nuclear excitations, and can't really do much at the molecular level - therefore, the material is almost transparent.
All this is so oversimplified...
Well, the starting point is that light-matter interaction is an immense field of physics. Even if we focus only on a particular kind of radiation the effects it can produce are a lot, depending on the elements with which interacts, and on how they are combined together (for example if they are free atoms, or bounded together forming molecules or solids). Now, we can say that the intensity of a beam of monochromatic waves that encounters an object of width L, drops exponentially as it crosses that object,
$$ I(x)=I_oe^{-\eta x}$$
where x is the distance the beam has covered, and $\eta$ is called the absorption coefficient, which encloses the mechanism of interaction itself, so it is different for X-rays and visible light. Now, we can roughly say that when a beam of visible light interacts with the tissues of the human body, $\eta$ has a magnitude big enough so that light is entirely absorbed, and in part re-emitted, in a few nanometers (billionths of a meter). However, when we talk about X-rays, they are thousands of times more energetic than visible light, due to the energy-frequence relation, which is $$ E=h\nu =h\frac{c}{\lambda} $$
So the shorter the wavelenght, the higher the energy of the photon. Remember that all kinds of electromagnetic waves have a quanto-mechanical description based on the photons, which are the quanta of energy carried by the electromagnetic field, but anyway. Turning back to X-rays, their energy is high enough to travel across the body tissues without it being absorbed; this is because the energy of X-rays is of the order of the atomic levels of the heaviest elements, which are scarcely present in a healthy body. The majority of human tissues are formed by light elements, such as carbon, oxygen, hidrogen, etc. that are unlikely to absorb an X photon. So they are free to cross the body, everywhere but tissues as bones, composed of elements that can "easily" absorb an X photon.
Best Answer
A Faraday cage need not be a continuous conductor — you can make a reasonable Faraday cage out of chicken wire. The rule of thumb is that if the gaps in the conductor are small compared to the wavelength of the electromagnetic wave, the wave "won't notice" and the conductor will appear continuous; if the gaps are bigger than the wavelength, parts of the signal can pass through the cage without interaction. So a chicken-wire Faraday cage could be a good blocker of meter-scale radio waves, but would definitely be a poor blocker of millimeter-wave radio.
X-rays and gamma rays have wavelengths comparable to or smaller than the spacing between atoms in a metal, so even a solid piece of metal "looks like" a chicken-wire fence with lots of gaps.
An alternative explanation (which isn't as different as it might seem) is that radio waves can transfer energy to many of conduction electrons at once, making them slosh around. But there aren't any high-frequency collective motions for bound electrons in the conductor, so x-rays and gamma rays tend to excite single electrons and to give them enough energy that they essentially become free particles. (This is "Compton scattering"; photons above 1 MeV can also lose energy by creating electron-positron pairs.) Since the electron motion isn't collective, it doesn't really matter any more whether the electrons were conducting or not beforehand, and so conductors don't really make better shields for x-rays and gamma rays than similarly-dense insulators.