Originally, missiles were not guided by their own onboard systems. Heck, even today I am not certain that is the case. I believe they all receive telemetry updates (sometimes every few miliseconds) from a secondary facility (launch center, etc.). ICBMs only launched high enough to obtain orbit. After that, the warheads were unguided and had no thrusters to change course. They reentered the atmosphere based on mathematical calculations as to the angle the missile entered orbit (angle of attack), speed, etc.
incredibly lulzy description of missile guidance
That's a fine theory for describing the very first, very primitive Earthling phasers. However, Kirk's phasers worked perfectly well at devastating power across extreme ranges in "Balance of Terror"; the only concern that Sulu and Stiles had was that they weren't going to hit anything much at that distance (equal to two minutes of travel at emergency warp).
I don't know if the Romulan ship was at warp in that scene, and suspect it wasn't. I imagine there is a concern about Enterprise flying into her own phaser shots if phasers can't go at warp speeds, but I am also not sure if she was firing directly ahead. The maximum range of phasers has not been stated (TNG manual gives a maximum effective range, but I figured this had to do with targeting), but the concerns about hitting seem to me as if they make this work OK.