Truth is you can't really do anything. Hug the reef if there is one. In open water, if the shark wants you, you can't stop it.
I had to bump 2 aggressive reef sharks in Belize, they had obviously been fed by some of the dive ops, when they came at me it was very quick and the best I could do...