FWIW, it's better to stop and talk to the dog. Dogs don't really want to bite you, most will just chase you and don't really even know why. If you stop and confront them, they are confused and don't know what to do next.
Get off the bike on the side opposite of the dog and keep the bike between you and the dog just in case, if you are afraid.