In 1895, a physicist named Wilhelm Roentgen was doing experiments with a cathode tube, a glass container in which a beam of electrons lights up a fluorescent window.
He had wrapped cardboard around the tube to keep the fluorescent light from escaping, when something peculiar happened.
Another screen outside the tube was glowing.
In other words, invisible rays had passed through the cardboard.
Wilhelm had no idea what those rays were, so he called them X-rays, and his discovery eventually won him a Nobel Prize.
Here's what we now know was happening.
When high energy electrons in the cathode tube hit a metal component, they either got slowed down and released extra energy, or kicked off electrons from the atoms they hit, which triggered a reshuffling that again released energy.
In both cases, the energy was emitted in the form of X-rays, which is a type of electromagnetic radiation with higher energy than visible light, and lower energy than Gamma rays.
X-rays are powerful enough to fly through many kinds of matter as if they are semi-transparent, and they're particularly useful for medical applications because they can make images of organs, like bones, without harming them, although they do have a small chance of causing mutations in reproductive organs, and tissues like the thyroid, which is why lead aprons are often used to block them.
When X-rays interact with matter, they collide with electrons.
Sometimes, the X-ray transfers all of its energy to the matter and gets absorbed.
Other times, it only transfers some of its energy, and the rest is scattered.
The frequency of these outcomes depends on how many electrons the X-rays are likely to hit.
Collisions are more likely if a material is dense, or if it's made of elements with higher atomic numbers, which means more electrons.
Bones are dense and full of calcium, which has a relatively high atomic number, so they absorb X-rays pretty well.
Soft tissue, on the other hand, isn't as dense, and contains mostly lower atomic number elements, like carbon, hydrogen, and oxygen.
So more of the X-rays penetrate tissues like lungs and muscles, darkening the film.
These 2-D pictures are only useful up to a point, though.
When X-rays travel through the body, they can interact with many atoms along the path.
What is recorded on the film reflects the sum of all those interactions.
It's like trying to print 100 pages of a novel on a single sheet of paper.
To see what's really going on, you would have to take X-ray views from many angles around the body and use them to construct an internal image.
And that's something doctors do all the time in a procedure called a CT, Computed Tomography scan, another Nobel Prize winning invention. Think of CT like this.
With just one X-ray, you might be able to see the density change due to a solid tumor in a patient, but you wouldn't know how deep it is beneath the surface.
However, if you take X-rays from multiple angles, you should be able to find the tumor's position and shape.
A CT scanner works by sending a fan or cone of X-rays through a patient to an array of detectors.
The X-ray beam is rotated around the patient, and often also moved down the patient's body,
with the X-ray source tracing a spiral trajectory.
Spiral CT scans produce data that can be processed into cross sections detailed enough to spot anatomical features, tumors, blood clots, and infections.
CT scans can even detect heart disease and cavities in mummies buried thousands of years ago.
So what began as Roentgen's happy accident has become a medical marvel.
Hospitals and clinics now conduct over 100 millions scans each year worldwide to treat diseases and save lives.