You could try out different fly sprays to see if it is the smell of the one you are using.Otherwise I would recommend showing them the bottle then spraying it (Not in there face) to show them it will not hurt them.Hopefully this helped!
I take an old spray bottle and fill it with water and then use this to get them used to it (this way I don't waste expensive fly spray) make sure your horse is not tied up when you spray it. If they keep moving when you spray it jut keep doing it. When they stop moving or relax stop spraying. This rewards them for their good behavior and they learn that if they just stay still it will be over faster and they soon learn to enjoy it.