The problem you decribe is called "water hammering" The cure is to install some "air chambers" at the highest point of the water line, ( if your house has a basement that may be right where the lines turn to go into the tub faucet,(at the faucet itself) remove the elbow and replace it with a tee,with the branch of the tee going into the faucet put the air chamber on top and the water line on the bottom,(I'd do the cold side too, while I was at it)These act as a sort of shock asorber and will solve your problem, you can get them at a plumbing supply house, or at Lowe's already made up, or you can make them your self, there also 2 types of these things, one is mechanical, and the other is just a peice of 3/4" pipe about 14-16" long capped at one end, and reduced down to usually 1/2" at the other end, it works simply, water pushes against the air trapped inside,and the air asorbs the shock,Problem solved, the mechanical ones do the same thing but, they have a diaphram and a strong spring and are alot smaller, and more costly, if you can sweat copper pipe you can make a set up for about $2.00 in fittings and whatever some 3/4" pipe, solder and paste ,sandcloth will cost, the mechanical ones last time I looked were about $15.00 each,either will work just depends on how much you want to spend and if you can sweat copper, (assuming you have copper water lines) if you have galvanized screwed pipe as your water piping then the problem is a little more complex, you still need the air chambers, but you'll also need 2 pipe wrenches,(12-14" wrenches will do just fine) pipe dope, teflon tape,pipe fittings, and carefully look the system over, find the highest point, and thats where you want the air chambers, I'cant tell you how to pipe it up without seeing the system so you'll have to figure that out