This overview should get you close,
Create a cylinder with a small radius, modeled so that one end is at 000 and the other at 00,-1. Use subtraction and Vector3.Distance to find the distance and direction from the end of the weapon to the target. Scale the cylinder in the Z direction by the distance from the end of the gun to the target (createScale(1,1,Distance). create a world matrix for the cylinder with the direction to the target as Forward and the end of the weapon as the position (Matrix.createWorld(direction,position,up). Then, you can swap out textures each frame to create some type of animation on the texture, or if you're using your own shader the sky's the limit.
Best,
Byron
..shaders make you feel... powerful, or very very stupid.
http://drjbn.spaces.live.com/