I use pepper spray, doesn't seem to hurt them, just makes them freeze and get a "wtf?" look on their face. It's probably a Bad Idea (tm) to use treats to get them to leave you alone. They'll associate treats with attacking cyclists, which will suck for the next bloke who comes along and didn't bring treats. If you're off your bike for whatever reason, placing it between you and the dog works wonders. Saved me from 2 crazy dogs tearing my face off last year.