The 21st century has been a real disappointment so far. Our robot servants top out at mediocre vaccums, self-driving cars are years away (and won't be able to fly even when they do arrive), and we're closer to inventing tricorders than phasers. A tricorder. Who wants a goddamn medical scanner when you could be blasting baddies with awesome handheld lasers?
It turns out that weaponized lasers, also known as Directed Energy Weapons (DEWs), aren't all that different from the non-lethal variety you use to amuse your cat. Just like conventional models, a DEW produces a single synchronized wavelength of tightly focused, intense light that can travel exceptionally long distances. In fact, many lasers today—even cheap, handheld pointers—are still pretty dangerous in certain circumstances. Most notably, they can cause temporary to permanent blindness, though this usage is banned under the Protocol on Blinding Laser Weapons. Yes, that's a thing.
While the PBLW bans lasers as blinding implements, it doesn't say anything about using them to light up hostiles like the Stay-Puft Marshmallow Man. Weaponized lasers, such as the ones currently being installed on fighter jets, melting outboard motors, or shooting mortars and other incoming projectiles out of the sky, operate by hitting a target with a stream of syncopated light pulses. As each pulse strikes the target, it imparts energy, which creates heat. As the target surface heats, it rapidly expands and ablates (a form of evaporative erosion). In other words: Powerful lasers can put holes in shit. What's more, DEWs are exceptionally precise, have zero recoil, and their beams move at light speed. Official* military assessment of the combat potential for weaponized lasers: fucking awesome. So why don't we have them?
It's not for lack of trying. Nations have been attempting to build DEWs since Robert Watson-Watt investigated "Death Rays" for the British Air Ministry in 1935 (and stumbled upon radar technology). Currently, the US government is exploring a variety of different lasing methods including solid-state lasers, which utilize a solid crystal lasing medium, gas lasers that use reactive helium-neon or carbon dioxide to shoot infrared beams, excimer lasers that use a combination of reactive and inert gases to shoot ultraviolet beams, and florescent dye lasers that can be "tuned" to fire within a specific wavelength range. Unfortunately, all of these lasers suffer from a common technological limitation called divergence.
As Alan Fry, Deputy Director, LCLS Laser Science and Technology Division at the SLAC National Accelerator Laboratory explains,
A laser beam will diverge (get larger) at a rate that depends on the beam size and the wavelength. Long wavelengths diverge more rapidly than short wavelengths. With the same original beam size, a 1nm wavelength X-ray laser beam will diverge 633 times less than the red 633nm He:Ne lasers that are used to scan the bar codes on your groceries. If you are making a long ranger laser rifle, you will do a bit better with shorter wavelengths in terms of the beam size hitting your target (say blue light instead of red light), but short wavelengths are more prone to scatter from particulates in the air (which the main reason that the sky is blue), so there are trade-offs. A larger laser beam will diverge less, but then it deposits less energy per unit area, which isn't good if you're trying to destroy the thing you are hitting.
Basically, short wavelength laser beams cause more damage to a smaller area but require greater accuracy (like hunting rifles) while long wavelength beams inflict less damage over a larger area but are easier to aim (like shotguns).
And divergence isn't the only issue. Blooming, where the energy of a sufficiently powerful laser breaks down the air around it into plasma, considerably depletes the energy of the beam. The presence of rain, snow, dust, fog, smoke, or dust in the air makes it worse.
To get around this issue, researchers from MIT and the US Army have tried using extremely short beam pulses and focusing multiple smaller lasers—that aren't individually powerful enough to bloom—on a single target, both with limited success. Conversely, electrolasers have shown promise in overcoming blooming by using the plasma created by the beam as a tunnel through which it discharges a powerful electric current. It's essentially a long range stun gun that fires laser beams rather than mechanical leads before zapping you.
Perhaps the biggest obstacle standing between the real world and GI Joe, though, is power. It's not like a hand-held laser is going to run on a couple of D batteries. Generating the power necessary for such beams currently requires truck-sized support equipment. The current state of electrochemical battery technology simply isn't advanced enough to stuff a sufficient amount of energy into a clip-sized storage device. Plus, all that energy passing through a relatively small, rifle-sized device is going to generate a lot of heat, which means that weapons will need active (read: energy sucking) cooling systems, or as-yet undeveloped superconductors, in order to fire more rapidly than your standard musket.
In short: we don't have the energy sources or lensing capabilities for practical handheld lasers. Yet. But honestly, given recent events, the lag from sci-fi to reality might not be such a bad thing.