I would go with pepper spray, with a few caveats. First, 90% of the pepper spray on the market is junk. The best you can get is by Fox Labs, the "cone mist" type, NOT the stream. This stuff has been described as feeling like "somebody dumped a spoonful of fireants on each eyeball." There are numerous YouTube videos of people getting sprayed with this stuff.
There are NO devices that don't have to be used properly, however. If you're using pepper spray, for example, DON'T hold it out in front of you at arm's length, where your attacker can anticipate it or knock it out of your hand. Put your finger on the button, but keep it concealed so you can spray him by surprise at just the right moment.
DON'T carry your pepper spray or defense tool on your keychain! If it gets dropped, thrown or broken in a struggle in a dark parking lot, you're stranded out there without your keys. Also, it will take longer to get the device positioned in your hand if it's tangled up with a dozen keys and Las Vegas key fobs.
Be AGGRESSIVE! ATTACK your assailant, SAVAGELY! This is what a lot of people don't prepare for psychologically. Go into "animal mode." ATTACK! DESTROY!
When the spray hits and he raises his hands, kick the HELL out of his kneecap, and I mean HARD. Kick it CLEAR INTO THE NEXT COUNTY! When he drops his hands instinctively in reaction, soak his face with it again. When he raises his hands back to his face, kick the other kneecap, or wallop him with a club or rock or something. I mean, just beat the living CRAP out of him!! You get the picture. Trust me, if you don't, he WILL do it to YOU.
Whatever you use, use it as a TOOL to enable you to disable the attacker, so you can safely get away. But without that focused, self-defense mindset, it's worthless. It's not like you go to the store, buy it, stick it in your purse or pocket, and everything's peachy.