How does x-ray attenuation compare to sound wave attenuation? When it comes to medical imaging (x-ray and ultrasound specifically) there seems to be a difference between the attenuation of sound and x-rays.
What I am gathering is as follows:
When it comes to x-rays, softer (lower frequency and thus energy) x-rays attenuate more than hard x-rays.
When it comes to sound waves (in ultrasound imaging), however, the higher frequency waves are more easily attenuated.
Firstly: is that true?
And if it is: why is that the case?
 A: Higher energy x-rays travel through tissue (and any substances) more easily than low-energy rays. Note that the energy of an x-ray (electromagnetic ray) is given by $$E=h\nu$$ where $h$ is Planck's constant and $\nu$ is the frequency. So if the frequency is increased then so to is the energy. This means that higher frequency x-rays travel through tissue easier than lower energy ones, so that attenuation is greater for low frequency x-rays.
This is not true for ultrasound. For ultrasound, the higher the energy the greater the amount of attenuation. There are many reasons why attenuation occurs in human tissue, and many sources of attenuation occur at specific (and relatively small) length scales that correspond to shorter wavelengths which also correspond to higher frequency since $$c=f\lambda$$ where $c$ is a constant (speed of sound in the medium). Therefore (for similar amplitude $A$ of sound waves) higher frequency (energy) results in greater attenuation. Note that the energy for a sound wave $$E\propto A^2f^2$$
A: The mechanism of ultrasound absorption, is damped resonance.   Every sound-carrying mode has some response that is slightly lossy, and generally loses a fraction of the energy per cycle of the signal.   That means higher cycles-per-second results in higher energy loss rates.
The mechanism of X-ray absorption, though, is (mainly)
photoelectric effect.   The rates of absorption are in proportion to
quantum-mechanical constants called 'matrix elements'
which are calculated as  integrals of the product of the
oscillatory electric field of the X-ray, with the
electron orbitals of those involved electrons.   High
X-ray frequencies correspond with short wavelengths, and electron orbitals scale with the Bohr length.
The integral of that product will vanish when the oscillation wavelength is short compared to the orbital, because
the oscillation is switching from positive to negative
while the electron orbital remains nearly constant.  The
product, therefore, averages to zero.
Thus,
a sufficiently high energy/short wavelength X-ray becomes
very non-interacting (and penetrates without much attenuation).
As a practical matter, the energies of X-rays above photoelectric-effect absorption are called 'gamma rays',
and mainly only interact with the (very small) nuclei
of atoms.   Size  matters.
