Like in real life
A simple way is to set the pos of your flashlight to the front of your gun. vec_for_vertex is very cool in this case. Open MED. Create a vertex in front of the gun model. Place the number of this vertex in vec_for_vertex.
edit: If the gun is all dark now u could create another light above the gun to "fake" it brighter (normal light with very low values, no Spotlight). If i remember right AMBIENT is not working with shadeC in this case.
In my project Player can modify weapons with flashlights. This way the flashlight-start-point is the real pos of the bulb then.
edit: And i remeber having the same design issues back then...soon ill rewrite my flashlight script, then i see if i used two lights or if i found another trick.