Yes Pit Bulls can be stopped by spraying them in the face and eyes with pepper spray.
The best thing to do is to try and get away from the Pit Bull if possible such as backing away slowly but keep the pepper spray available and pointed towards them and if they decide to attack then spray them with the pepper spray.
Sometimes a gun will be required to fully stop the pit bull and once a pit bull snaps and attacks someone for no apparent reason they will attack again.
Pit Bull dogs can seem loving around people and kids but even when you treat them right they do snap eventually and can turn on the owners.
There was a story in the news awhile back about a toddler being attacked by their own pit bull and it killed the toddler.
The pit bull had been a loving dog for around 5 years and then it suddenly snapped and attacked.
In that case the dog needs shot but if all you have is some pepper spray then that will work to get the dog away from you so you can safely get away.