Object not tracking all the time?
You have to keep the script running all the time, it is better to have an always sensor in pulse mode attached to the Python controller :



or just activate the pulse mode on the ray sensor to keep activating the script even if the hitObject is the same :