The most basic would be to spawn a rectangle "bullet" (has bullet behavior attached) of the color you want from an image point on your ship.
Make an event that checks if the mouse button is held down AND is over target AND within your specified distance then if all true spawn bullet at image point on the ship.
Upon creation set, the bullet's speed to something high like 3000, set its angle to Mouse.X, Mouse.Y.
Test this and you will see a visual "laser" streaking from your ship to the target (and past it). If there are gaps then make bullet rectangle longer.
You will now need to destroy the bullet "laser" pieces as they hit. This takes some adjusting since your bullets are longish.. you will need to put a Wait=0.01 or 0.02 to make it "look" right and maybe even tweak the values more so it looks like it is constantly striking target like a laser would.
Also on collision is not best option due to bullet speed, so use On-overlap wait=0.02 destroy bullet.
If you did everything right you will have a cool "poor man's laser".