A raygun is a science-fiction directed-energy weapon that releases energy, usually with destructive effect. They have various alternate names: ray gun, death ray, beam gun, blaster, laser gun, laser pistol, phaser, zap gun, etc. 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-world analogues are directed-energy 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.
Ray guns were so common on magazine covers during the Golden Age of Science Fiction that Campbell's Astounding was unusual for not depicting them. The term "ray gun" had already become cliché by the 1940s, in part due to association with the comic strips (and later film serials) Buck Rogers and Flash Gordon.