In the Star Trek universe, a phaser is a directed-energy weapon that may range in size and strength from a handheld pistol to a ship-mounted device. A phaser (PHASed Energy Rectification) fires a powerful beam of light which can be controlled to cause a range of effects from stunning to disintegrating an opponent. The name and concept are, of course, derived from those of the laser.
Lasers were used aboard early Federation starships, as depicted in "The Cage" (ST original series) and "The Menagerie, Parts I and II" (original series). By at least 2265, they had been replaced by phasers, as seen in "Where No Man Has Gone Before" (original series), but not before 2200, according to Worf in "A Matter of Time" (ST Next Generation).
Roddenberry's original concept for the phaser
Star Trek creator Gene Roddenberry originally intended the phaser to be a combination of laser and particle-beam weapon. Thus, a discharge of accelerated electrons from the weapon could be used to stun an opponent (similar in effect to a Taser), or a large discharge of coherent energy plus heavier particles (such as neutrons) could be used to vaporize something or someone. Settings in between would have a variety of uses.
Given a couple of centuries (Roddenberry's original timeline), such a development seems quite feasible. In fact, given another ten years or so of developments in capacitor technology (currently, an AAA battery equivalent is a 6" by 2" can, representing a several-thousand-fold increase in efficiency over a decade earlier), it may be possible to a make a rudimentary, but practical laser weapon of 10 kilowatts.
Of course, outside of Hollywood, the discharge of such a device would not be neat and tidy as shown in Star Trek and would no doubt do considerable damage to anything behind the intended target, not to mention the effects of the associated cloud of superheated air.