I know this sounds counter intuitive, but the one thing that always worked for me was to get on the bike, and charge straight at the dog. Everytime I did this, the dog backed off.
Dogs have their own sense of self preservation too.
I would not do this with a pit bull, they don't seem to...