So there are a few traick I've learned.
NEVER hit the horse on the head or nose. This just makes him headshy, and most of the time horses are to fast at biting for it to be prevented. Instead, after your horse has tried to bite you, you have 3 seconds to make him think it was the worst mistake in his life. Throw a bucket, yell, scream, whatever works, but never resort to physically hurting him. You want it to be emotional for the horse (they are very sensitive).
If you find this too harsh, or it scares your horse too much, try making a loud BUZZ sound (think of a gameshow when the contestent gets an answer wrong). Most horses hate this sound and they will learn a bite leads to something unpleasant.
Hope this helps!
Ride hard -- ride safe.