A long treatise....
I, too, am sorry you had to go through this experience.
I'm going to be brutally honest here. There are times that a person just cannot prevent an attack. This, though, likely was not one of them. I would wager a weeks pay that this guy did not just happen to find himself in a ladies bathroom, lock the door and then discover you there. You were likely either seen entering the bathroom, or more likely seen elsewhere and followed. Rapists do not randomly check women's bathrooms. They select victims and stalk them until the victim places themselves in a place of vulnerability.
In today's age, it is not popular to point out what a rape victim could have done better to avoid the horrific experience of rape. It is called "blaming the victim" by the very people who seek to remove the woman's options of self defense. In reality, self examination and scutiny of the incident is necessary to protect yourself from a reoccurance. When a man gets beat to the ground, it's OK to say "He should not have done __________(fill in the blank). When a woman is raped, or a rape is attempted, it is not politically correct to do the same. Put that nonsense aside, and examine your own actions, intuitions, and thoughts prior to the incident. Realize that the best way to prevent your particular event would have been to never go into that bathroom alone.
I once read that humans are the only animals on Earth that rationalize away their fear. All other animals, from lions to dolphins, to fruit flies act on fear. Humans want to believe their world is safe and active self preservation is not necessary, so they convince themselves that their intuition is wrong, and that unsafe actions and unsafe places are indeed safe. The real world is not what ought to be, but what is. Sometimes this rationalization is so imbedded we do not even know we have supressed our intuitive voice that is trying to warn us.
So where does this leave us? While in the mall, did you have any inkling you were being followed or observed? When you went into the bathroom, did you have any feeling of the same? Did you have any reservations at all? If so, realize that was the little intuitive voice that will save your butt, and respect and cultivate it. If not, become more observant. I am not saying become paranoid, but more aware of what is happening around you. Realize that it is the voice, the intuition, the fear, that will save you, not pepper spray, not a knife, and not a gun.
Here is a good link to read up on. Keep an open mind and read it.
No Nonsense Self Defense
Now, here are my thoughts on rape protection (not prevention) with tools instead of wits. If all else goes to a handbasket, and you were unable to detect a potential threat and are about to be raped, the encounter will be close quarters and swift. There will be an attempt to immediately overpower you with force, likely from behind. You will likely not be exchanging blows, but wrestling for control and escape.
To escape you MUST neutralize your attacker. You did this with a kick to the groin. Very good. You had that option and used it. It worked. Thankfully he did not have a friend along for the ride. You did what many other women could not do. Be proud of yourself.
But now you want a weapon. Realize that the weapon is not a magic talisman, but a tool to help you survive. Your determination and aggressiveness when attacked, which you have already demonstrated, is the magic talisman. Get the tool, but hone the correct talisman.
You have several weapons choices. I'll talk about each in relation to a close in on the ground type fight for your life.
Pepper Spray. As you saw, aim is vital with this stuff. The real danger though, is if the can is old or has sat in your hot car, and lost pressure without you knowing it. I have seen cans of OP squirt out a stream that would make a man with prostate cancer ashamed. In a ground fight, you simply do not have the range to use it effectively, and if your attacker's shoulder had rubbed across your face, guess what? You would be fighting blind. I don't like pepper spray. I expect any fight I will be in to be going to the ground quickly, and this is to much of a risk for me.
Knives. A better weapon IMHO. If you can legally carry a 5-6 inch knife (non-folder) in a boot, you will not likely find a better weapon in a ground fight. The real questions are what is legal, and will you use it effectively. This is not a disabling weapon. This is a deadly weapon. The bad thing about knives is if you end up in front of a jury, they tend to be seen as even worse than a gun. Carrying knives are considered by many people to be a sign of a low class hoodlum looking for trouble. That does not negate their effectiveness in a fight though. If you know your laws, get an effective knife, train with it, and are willing to use it, it's hard to beat. Knives don't run out of ammo. The real risk is the aftermath of legal issues.
Guns. There are two basic types of handgun. Semi-Autos and Revolvers. I like them both and have no real prejudices. Many people like semi-autos best. I will say that in a close in fight for your life a revolver is superior. Why? Because you can jam a revolver into your assailant's ribs and fire it repeatedly. If you do this with a semi-auto, you will push it out of battery and it will not fire.
Many people say that the revolver is handicapped because of capacity. On the surface, this would seem to be the case. In a running gun battle at any distance, it would be handicapped. The reality of attacks on the street though are not running gun battles, but quick unsuspected take downs and beatings on the ground. You do not have to hold your ground with your gun. You only need to use it as a tool to facilitate your escape to safety. In your attack, escape was likely less than 50 feet. In this scenerio, a tool to facilitate escape, capacity means less, effectiveness means more. My vote is for a snubnose revolver. I carry one, so don't think I am recommending a "lesser" gun for a novice or a woman. The snubbie revolver is the finest real world close in fighting handgun around. Buy one with a shrouded hammer or a concealed hammer for ease of drawing. Buy it in .357magnum for penetration at muzzle contact. If you opt for .38spl, carry +P ammo (this is my compromise). Buy a quality gun. Think Smith & Wesson.
Finally, I know you are young and do not want this kind of thing to control what you want to do with your life. Realize how important effective realistic self preservation is though. When you think about going to a place like California, do not rationalize away you need for protection. I don't think you would go to Baghdad without any protection, why would you want to go elsewhere and walk unprotected. You can die just as easily in either place. Personal attacks in California are less likely than in Baghdad you say? Are they? It's a gamble isn't it? Do you gamble with your life often?
Welcome to the Firing Line! I hope you stick around. I'm sorry for the long treatise, my oldest daughter was raped a couple of years ago at the age of 21. This is basically how I talked with her. I hope you are not offended by my words, they are made with the best of intent. The most important thing for protecting yourself though, is that voice of intuition, the one we try to rationalize away. The one that just may be saying "California? Wait a minute, I can't carry a gun there........" Listen to that voice and be protected by it.