X-Rays are a form of electromagnetic radiation similar to gamma radiation except X-Rays are produced when an electron is slowed down from a high velocity and gamma waves are produced from radioactive materials decaying.
In an X-Ray machine, a filament wire heats up and releases electrons through the photoelectric effect. The electron then passes through a vacuum towards an attractive anode plate, usually made of tungsten, and decelerate as they pass through the material.
The electrons are slowed as they move through the plate’s electric field but occasionally they rearrange the electrons in the atom so that when they go down an energy level they release an X-Ray. These are known as breaking radiation and characteristic radiation respectively.