Making a scaling Beam Object

I am making a boss battle in my 2D sidescroller and I need help with making a beam attack. The problem is I can’t figure out how to scale the beam properly as using localscale with scripting makes the beam scale from a middle point. I need the beam to scale from a side point. Here is a GIF picture to show what I want to do.

(This is a GIF picture)

There is a dropdown box in the sprite import settings where you can change the pivot to some preset values.
If you ever wanted even more control, you can open the sprite editor (in the import settings, also) and move it manually
Put the pivot on 1 side and you should get what you want.