A raygun is a type of fictional device that fires a beam of (usually) destructive energy used in science fiction; a form of directed-energy weapon. They have various alternate names: ray gun, death ray, beam gun, blaster, laser gun, laser pistol, phaser, zap gun, etc. They are a well-known feature of science fiction; for such stories, they typically have the general function of guns. In most stories, when activated, a raygun emits a ray, typically visible, usually lethal if it hits a human target, often destructive if it hits mechanical objects, with properties and other effects unspecified or varying.
Real-life analogues are particle-beam weapons or electrolasers, electroshock weapons which send current along an electrically conductive laser-induced plasma channel.
A very early example of a raygun is the Heat-Ray featured in H. G. Wells' novel The War of the Worlds (1898). Science fiction during the 1920s described death rays. Early science fiction often described or depicted raygun beams making bright light and loud noise like lightning or large electric arcs.
According to The Encyclopedia of Science Fiction, the word "ray gun" was first used by Victor Rousseau in 1917, in a passage from The Messiah of the Cylinder:
All is not going well, Arnold: the ray-rods are emptying fast, and our attack upon the lower level of the wing has failed. Sanson has placed a ray-gun there. All depends on the air-scouts, and we must hold our positions until the battle-planes arrive.
The variant "ray projector" was used by John W. Campbell in The Black Star Passes in 1930. Related terms "disintegrator ray" dates to 1898 in Garrett P. Serviss' Edison's Conquest of Mars; "blaster" dates to 1925 in Nictzin Dyalhis' story "When the Green Star Waned;" and "needle ray" and "needler" date to 1934 in E.E. Smith's The Skylark of Valeron.