As an extension of the suggestions below (being patient and going slow, starting at the legs, etc.), I also use treats (small cookies or baby carrots) when starting to get horses used to being sprayed. All about positive reinforcement :)
Put water in the spray bottle, so you don't waste your product. Start with spraying the air beside them but low, then legs, then chest, flank, hind end, back, and slowly work up the neck. It takes practice. Do a little everyday - do not tie them. I usually let them investigate the bottle first, and spray low in the opposite direction. Let them settle, then work your way up.
Limit it to areas they are less sensitive. I can now spray my horses body but can't get the neck sprayed yet. It just takes time. I started with her quarters as she didn't mind that as it was so far from her face! I can do her sides now though she flinches a little. She no longer runs away so she has improved a lot.