X-rays are a form of energy that travels in waves. X-rays can enter solid objects, where they either are absorbed or continue to pass through. X-rays tend to be absorbed by denser objects. They pass easily through less dense objects.
Teeth and bone are very dense, so they absorb X-rays. X-rays pass more easily through gums and cheeks. That’s why cheeks and gums appear dark and without detail on a dental X-ray, but teeth show up much lighter. Restorations such as crowns and fillings are even denser than bone. They show up as solid, bright white areas on X-rays. Dental decay and caries (cavities) appear as darker patches.