Keep in mind, I'm a C2 noob
You'll need to use this expression, that's all: distance(x1, y1, x2, y2) Calculate distance between two points
hypothetical: We want a beam to hit player. I would set the origin of the beam to x=0 and y= 1/2 of the height
Sprite Names:
beam
player
Set the width of beam with an 'every tick' event:
beam set angle towards position player.x, player.y
beam width = distance(beam.x, beam.y, player.x, player.y)
WARNING: This will distort the image of the sprite if its fancy lighting like in the picture you show. That should work, don't have the time to test myself though, sorry.