We spend most of the summer in Sitges, near Barcelona and I know from personal experience that the only thing the lifeguards have here, and presumably the rest of Spain as well, to deal with them is vinegar. Please take Waspeze with you. It is the only thing that works well enough to alleviate the pain until you can get to a doctor.
On a related note please be aware that there are three separate classes of ambulance call out. If you, or any of your family, are seriously injured or suffer a heart attack or stroke you HAVE to specify an ambulance " con doctor" otherwise you will just get either an ambulance with someone to load the casualty in or one with paramedics. Last year an ambulance was called out for a friend of a friend who collapsed and was complaining of severe head pains. He had also been sick. He was made to walk to the ambulance 50 yds away. It later turned out that he had had a brain haemorrhage!
Àlso make sure that you have emergency numbers in your phone marked ICE. In Case of Emergency. And that someone close to you knows the access code for your phone. It was extremely difficult to get in touch withe family of the guy who had the brain haemorrhage as his partner didn't have the same surname.