The priority when playing from a fairway bunker is to get the ball out of the bunker first and foremost.
Rather than looking at the distance you have left from the bunker and using this to help select the club, look at the angle or trajectory that the ball needs to get over the lip of the bunker. The height of the bunker face, or whereabouts the ball is in relation to the face, will dictate the trajectory that you need to hit the ball at and this is what should dictate the club you then use. Pick a club that will give you a trajectory that allows the ball to clear the bunker face.
With a fairway bunker shot, you are also looking to play the ball first and then the sand, or to take the ball cleanly off the sand. In a greenside bunker, you aim to hit the sand rather than the ball. Make sure you work on hitting the ball first.
Once you have selected a club that will clear the bunker face, play this shot to strike the ball cleanly from the surface, rather than taking sand. Set your feet as you usually would to play the selected club from the fairway but wriggle your feet into the sand to create a firm and solid base to swing from. As you have lowered yourself down into the sand and we want to strike the ball before the sand, hold one to two inches down on the handle to encourage the club head to swing above the sand and also hold a little tighter than usual, to encourage you to hit the ball rather than the sand first. If you squeeze the club handle as tightly as you can hold and we call this a 10, then drop your pressure to around a 6 for this shot. Holding at this pressure will slightly engage your arm muscles and whenever your muscles work they contract and shorten, so effectively you are lifting the club head slightly higher than the surface you are striking from. Look at the top of the golf ball and work on hitting the ball rather than the sand.
Take an extra club if you can make the green, provided that it will clear the lip and then this will allow you to swing smoothly and steadily. As you swing the club back, maintain a good spine angle and head position as you rotate your upper body to the right and swing through the ball, maintaining you head height and spine angle. If you allow your spine angle to drop or lift during your backswing you will find it difficult to achieve a good, clean, crisp strike with the ball.
Make sure you maintain your balance throughout your swing and on your down swing, work on approaching the ball from a shallow angle rather than a steep downward angle. If you think of the movement that the club head needs to make, you need to create a U shape swing with the ball at the bottom of the U, rather than a steep V shape swing where the club head will strike the sand. Keeping your weight even on both of your feet at your set up position will encourage this swing shape.
Continue with a gentle, shallow angle of attack back towards the ball and a full follow through, finishing as you would if you had hit the ball from the turf. Your right heel should be up from the surface and your right foot rotated so that your shoe laces are towards the target. Leaving your right foot flat on your follow through will cause you to hit the sand first before the ball and cause a fat shot.
Work on achieving these points the next time you are caught in a fairway bunker and you should see that you escape the sand but still gain vital yardage.