Rays and beams generally consist of separate origin, body, and target/hit parts. The body part is the part that tiles with a variable size. This can be done with sprite objects + tiled background for the body, or a 9patch (at least we can rotate 9patches now!).
Unfortunately, we have animations for neither tiled backgrounds nor 9 patches, so you'll either have to stack multiple of them and manually cycle through their visibility, or create and destroy them as you go to animate.
You might also consider layering effects/additional sprites atop the path of beam, which can be animated, with the beam itself being mostly static.