Also when I encounter dogs I slow down to a walk, control my breathing, ignore the dog and use the mantra "walk and ignore" repeating it in my head. It takes every ounce of my will power and yoga pratice to do this though and if the dog is running at me barking I will call to the owner to control it as I am not very good with dogs. This usually works.
When I said run with someone else, choose someone slower than you, survival of the fittest
Hopefully you're not physically hurt, if you are get that sorted first!
Have you got someone you can run with who is confident with dogs? All my running partners know to shield me from dogs as I'm a big wuss, it's one reason why I prefer running in a group, safety in numbers!