I have a friend who's lived in Northern Spain now for 15 years. She said if you are working there, you need to apply for one of their Social Security numbers and get a card. This entitles you to all the same healthcare that the locals get. Then you register at your local GPs (you must have the SS number to prove you're paying taxes), and you will get free GP advice etc. However, my friend told me that each area/province in Spain has different methods and levels of healthcare, as it is run and supplied for by the mayor of the province. So, if you live in an area that spends a lot of the taxes on their healthcare, then you can end up getting some of your medication paid for by the government. She said she gets all her prescriptions for free, except one for her eyes because her GP deemed it unnecessary for ordinary health or something...
Anyway, that's all I know from my friend. If you work, make your company get you a social security card/number (they must supply you with one as you'll be paying taxes! No number, no taxes, illegal). Register at your GPs, there are always a doctor that speaks English, so be sure to register with an English speaking GP! Then have them arrange everything for you, prescriptions etc. You may have to pay for them, you may not. Depends on the province!