This is a very serious issue. Almost 4 million people per year suffer dog bites, and more than 800,000 need medical care for treatment (Centers for Disease Control figures). About half of those needing medical treatment are children. The majority (60%) of fatal attacks involved Rottweilers or pit bull breeds.
I agree with a prior poster who did not feel he should accept injuries in attempts to restrain an attacking dog, as opposed to attempting to inflict serious injury or death on the animal. Excluding a firearm, suitable lethal or non-lethal weapons to end a dog attack are debatable, and I have found few reliable statistics. At the very least a walking stick or cudgel should be available. Reports of the effectiveness of pepper spray are quite variable; for myself I would consider bear spray. There are a number of videos that have shown bear spray to be effective in discouraging black bears; however, those bears did not seem to be intent on harming the humans who sprayed them, and in a dog attack the anmal does intend to cause serious harm to a person. A handgun beats other alternative defensive measures.