The primary property of interest is electron density, which is a combination of atomic density and the number of electrons (Z) of the atoms comprising the absorber.
The atomic density, N, is given by \rho*N
A/A, where \rho is the mass density (g/cm
3 or kg/m
3), N
A is Avogadro's number (atoms/mole or atoms/kg-mole) and A is the atomic mass (g/g-mole or kg/kg-mole). Make sure units are consistent.
ZapperZ makes some good points, particularly the one about the properties of the absorber.
The other consideration is that the more energy a photon has, the more energy there is to distribute in the absorber. X-rays are relatively low energy 10 eV - ~150 keV, whereas gamma rays can be up to several MeV. A high energy photon will scatter, usually with a small angle (see Compton effect -
http://hyperphysics.phy-astr.gsu.edu/Hbase/quantum/comptint.html#c1) with a subsequent photon of lower energy, which scatters to another photon of lower energy and so on until the final photon is completely absorbed.
The other property of the absorber is the probability of interaction with a photon of given energy, and this is related to the electron density, which is related to the atomic density. The probability of interaction is described in terms of a cross-section.