X-rays are produced when fast moving electrons are decelerated upon impact with a metal target in an x-ray tube. The x-ray tube contains a cathode that emits electrons via thermionic emission when heated, and an anode target. Vacuum is necessary to allow electron acceleration and control. Rotating or stationary anode designs improve heat dissipation during x-ray production. Grid controlled tubes allow rapid on/off switching of the electron beam and x-ray output.