The potential for a death ray that would fire a particle beam or laser or radiation stream sufficiently powerful to kill humans, has been part of science fiction at least through the 20th century, and the subject of at least some serious weapons research.
After the astonishing technological advancement during World War I, many such schemes began to appear credible. Harry Grindell-Matthews tried to sell such a ray to the UK Air Ministry after that war. He failed to appear to demonstrate his apparatus, however. It was apparently taken to France but has not resurfaced, leading to various conspiracy theory ideas about what might have happened to it, or who might have developed it later.
Nikola Tesla was also supposed to be working on a form of death ray at the time of his death. He offered the US War Department the secrets of his "teleforce" weapon on January 5 1943 but was assumed to be crazy. He was found dead 3 days later and, after the FBI was contacted by the War Department, his papers were declared to be top secret. It appears that his proposed death ray was related to his research into ball lightning and plasma.
Through the 1930s the atomic bomb and radiological weapon were proposed, and the related, more selective, surgical idea of a death ray was probably more appealing than wanton and horrific destruction by such means. This belief intensified in the 1940s after Hiroshima and Nagasaki proved the undesirable physical and political fallout of such weapons of mass destruction.
Science fiction as far back as the 1920s had emphasized death rays as the weapons of choice. As the laser, invented in 1960, became industrial reality in the 1960s, the generic fictional death rays were often renamed lasers. By the late 1960s and 1970s however, the laser's limits as a weapon of were evident, and less specific terms such as "phaser" (Star Trek) or "blaster" (Star Wars) were used.
In the 1980s the aptly named Ronald Reagan (pronounced ray-gun) revived the idea as a matter for public funding with his Strategic Defense Initiative program, which was immediately nicknamed Star Wars, due to its objective to put weapons in space. The program had limited success but there were numerous attempts to find practical death ray technologies. It is not clear whether this was part of a general plan to facilitate the Collapse of the Soviet Union by misdirecting the Soviets into investing in research that had no practical outputs (this was a common Cold War strategy on both sides).
Enthusiasm for these ideas, and the arms race they implied, waned in the 1990s. By this point, science fiction was more interested in the very real potential of personal-scale biological warfare, chemical warfare, robots, artificial intelligence and nanotechnology to kill selected individuals - without necessarily having to come directly into their sights to do so. Project for a New American Century, for instance, noted that genetically-selective plagues might become a politically useful tool.