Pepper spray is used best when closer to your body. You usually see people use pepper spray with the fully extended. This may give the attacker a chance to grab the pepper spray or deflect your aim. Keep it closer to your body and fire into the eyes of your attacker. You can adjust your aim as you are firing.
After firing your pepper spray into the attacker's face, back up, if the attacker follows, spray him again. Even if they are under the influence of drugs, the defensive spray will temporarily blind them and make breathing difficult.
Remember, the aim is to escape, not to fight or to stick around and punish the attacker, he may have accomplices, he may have a hidden weapon. So, spray the pepper spray and then run away.