Linear accelerators (linacs) are used to generate high energy x-ray and electron beams for radiation therapy. A linac consists of an electron gun, radiofrequency power source, accelerating waveguide, beam transport system, and treatment head. Electrons are generated and accelerated to megavoltage energies using microwave fields in the waveguide. The accelerated electron beam is transported and bent using magnets to strike a target and produce x-rays, or exit directly as an electron beam. The treatment head houses the target, flattening filter, collimators, and monitors to shape the beam for patient treatment. Modern linacs provide flexible photon and electron beams with variable energies for radiation therapy.