There are of course many ways to accomplish this in Ps.........here's one way using two methods.
Create the boundary. Use whatever method you prefer. Here I have just used a simple rectangular selection across the "canvas"
Open your Gradient Tool. Set Color. Set the gradient (in the gradient editor) to Foreground to Transparent. On it's own layer create a gradient holding down the shift key. You can make multiple passes.
OR
Open your Brush Tool, set to (approximately) Hardness: 0%, Flow: 10%
On it's own layer, create a brush stroke in the color you desire the full length and height above boundary selection by holding down the shift key, clicking and then dragging from one side to the other.
Add a layer mask to either the gradient layer or the brush stroke layer. Open the Brush Tool. Set the brush to black, brush out/down the ends. This may take several tries and brush setting changes. Start with what's listed above.
Try both methods. I tend to get better and more accurate results with the Brush Tool method.