One of the things that is difficult in bunker shots is varying your distance. But the real key is just getting the right set up. When you set up for a sand shot your stance is open, your ball is forward in your stance and your clubface is open. The clubface should be open approximately the same distance to the right of the target as your feet are to the left of the target.
The Right Set-Up for Hitting Bunker Shots
So if I am going to play a short bunker shot I widen this V created by my clubface and feet angles. I open up with my feet a lot to the left and open up with my clubface a lot to the right. The face of the club is wide open and now I am going to play a very short bunker shot. If I am looking to just barely get the ball out of the bunker then the key is wide open with my stance and wide open with my clubface and the ball is just barely coming out.
Bunker Shot Distance
Now as I want to increase my distance, obviously I increase the length and speed of my swing, but I also square my stance up a little bit. Now I am slightly open to the left, my clubface is just slightly open to the right, a little bigger swing and a much longer shot. So you vary your distance on sand shots by widening your V for a shorter shot and narrowing your V for a longer shot. Feet more open, clubface more open for the wide V. Feet a little more towards square, clubface just slightly open for a narrow and a longer shot. This will make varying your bunker shots and the distance you hit them a lot easier.