You mean something like this?
Create a sprite with the lightning ray (static or animated).
When you fire your weapon, spawn this sprite, adjust its angle and width so it connects your weapon with the target.
You might want to add several variations of the ray image/animation and select one of them at random.