The popularity of cinema and the mass availability of guns are both manifestations of the modern age. The famous Colt .45 went into production in 1911, about the same time the cinema came of age. Villains on film have always menaced heroines, but to begin with the guns only rarely made an appearance. Early works such as "Birth of a Nation"(1915) and "Napoleon" (1927) featured battle scenes, where good cinematic use was made of mass volleys of rifle smoke.
In gangster movies and film noir, the gun was physically discrete; a snub-nosed .38 concealed in an overcoat, the occasional burst of a Thompson. Firearms played a larger part in Westerns, but gunfights were typically sanitised affairs, with bad guys dropping obligingly into the dust. An honourable exception is "The Hour of the Gun"(1967), concerning events at the OK Corral, which deals with the consequences of gun use.
The treatment was similar in war movies. In troubled times no-one wanted to see realistic depictions of bloody death; such films concentrated instead on the heroic aspects of their stories. SF films, with their determinedly futuristic aesthetics, typically featured square-jawed heroes wielding 'ray-guns' like toys. A classic example can be found in "Forbidden Planet"(1956), where Leslie Nielsen packs a neat 'disintegrator pistol'.
As the 60s progressed and soured into the 70s, realistic gun use appeared in the movies. Sergio Leone's 'Dollar' trilogy and Sam Peckinpah's various bloody epics showed the reality of bodily trauma and death. The transformation of the gun into a fetish object can also be traced to the 70s. "Dirty Harry" (1971) made Clint Eastwood's revolver an extension of his personality. His .44 Magnum speech ("Do you feel lucky, punk?") is now part of movie history.
The seminal "Star Wars"(1977) showed a down-and-dirty vision of the future. Ray guns were out, grimly functional blasters were in. The trend continued in films such as "Aliens" (1986) and "Starship Troopers" (1997), and was parodied by the ridiculous blasters used in "Men in Black" (1997). In these postmodern times the gun has become an object of desire. "Pulp Fiction" (1994) features chrome-plated hardware lovingly dwelled on by the camera. Hong Kong action cinema gives us hyper-kinetic gunplay, typified by the films of John Woo. His landmark "Hard Boiled" has one of the most frenetic gun battle ever seen on screen.
Nowadays, the idea seems to be to kill as many people as quickly as possible while still looking good. One wonders how the cinema will treat real ray guns, when they arrive.