An X-ray image, or radiograph, shows differences in photographic density between different parts of the object. Different parts of the object absorb X-rays differently depending upon composition, thickness, density, and atomic number of the material. The higher the atomic number of a material, the more X-rays it will absorb; gold, with its atomic number of 79, absorbs much more X-rays than materials with lower atomic numbers, such as aluminum (Z=13).
Let’s assume we have an object consisting of three parts A, B, C, such as the one on the left. All three sections, A, B, C, get hit by X-rays with the same intensity. The densest part of the three, part A, absorbs the highest amount of X-radiation and therefore appears darker in the X-ray image. Section B, the second densest part of the three, absorbs less X-rays than section A, but more than part C and therefore appears lighter than A but darker than C.
This shows that the final X-ray image is based on the fact that different sections of the object absorb different amounts of X-radiation due to differences in material composition and thickness.