The nearest I know of to a real ray gun is the Lockheed ADAM anti-missile laser (see also this popular article or Google for much more on the subject). The Lockheed laser is hardly portable, but who knows what a few centuries of power pack design might achieve and it shows that it can be done.
I don't understand your issue with the length of the laser pulse. Suppose you were aiming a torch at someone: as they move you just turn the torch to follow. Make that torch a gigawatt laser and there's your ray gun.
This effect is due to a change in the density of aerosols and dust particles at the top of the planetary boundary layer, the border between the part of the atmosphere which is turbulent due to surface details like trees, buildings, and topography, and the part of the atmosphere in which those details are ignored and wind flows can be laminar even at high speeds. You know how sometimes on summer days you'll see a patch of fair-weather cumulus clouds with irregular fluffy tops but flat bottoms, and the flat bottoms are all at the same low-ish altitude? That's the edge of the planetary boundary layer.
(source)
(source)
The intensity of light backscattered by aerosols at a distance $r$ goes like $r^4$, because you lose a factor of $r^2$ both on the way out and on the way back in.$^\dagger$ A relatively sudden change in the density of scatterers can drop the intensity of the scattered beam below the threshold of your visible sensitivity.
(This is part of the reason why it's a felony is the US the point a laser at an airplane, even if the airplane looks "farther away than the laser beam.")
Don't let my simple description here fool you: the atmosphere and its motions are complicated. Sometimes, for instance, there are multiple haze layers which are visible if illuminated correctly.
Last year, when poor weather interrupted an astronomy event, I successfully spotted a double-haze layer using a laser pointer from the ground:
the beam was bright from the ground, went dark, then continued further up with a bright spot on the second layer.
$^\dagger$ Two commenters protest that the drop in the intensity of the backscattered light should be proportional to $2r^2$ or $(2r)^2$ rather than proportional to $r^2 \cdot r^2 = r^4$. It's not a typo or an error. The intensity of the laser falls off like $r^2$ as long as $r$ is much larger than the distance to any waist in the laser beam. That determines the absolute brightness of the dust grain. The backscattered light from the dust grain isn't collimated at all, so you get another factor of $r^2$. This $r^4$ falloff in reflected or backscattered intensity is why the amazing lunar laser ranging experiment won't ever be repeated with retroreflectors on Mars.
Best Answer
Even in vacuum a laser beam's intensity will get weaker and weaker the more distance it travels. This is due to diffraction, meaning the wave will diverge and "take more space", thus the energy flux per unit area (intensity) will decrease. The total amount of energy is conserved, but the area it is distributed on gets larger and larger. You can see this yourself with a toy laser - the spot size gets bigger when you shine it on a more distant object, so the intensity at each point is weaker.
The angle of divergence of a TEM$00$ mode of a laser, the mode which diverges the slowest, is determined by the minimal spot size and the wavelength:
$$\theta=\frac{\lambda}{\pi w_0}$$ (where $w_0$ is the beam's waist radius)
Meaning if you want a beam to diverge really slowly and get to the moon with the smallest size (so the intensity will be larger), you should increase the beam diameter at the waist (the place where the beam is the smallest).