I'm sure Mike will answer Spain specific regulations and tips on what paperwork you need and how to get through the red tape but I when I was looking up the name of the new forms I came across this that might be useful.
http://ukinspain.fco.gov.uk/en/help-for-british-nationals/living-in-spain/pensions-benefits/healthcare/e121/
In general entitlement to state health care for retirees in another EU country depends on whether you are retiring with a state pension at official retirement age or if you are retiring earlier than this.
If you are retiring to an EU country
prior to receiving a UK
state retirement pension then you can apply for a form S1 (used to be a E106) from the Overseas Healthcare Team (Newcastle) 0191 218 1999
This will entitle you to treatment on the same basis as a resident of the country you are moving to.
but only for a maximum of 2.5 years (this depends on your contribution record and partly on the time of year you give up work and/or apply, few seem to get more than 2 years)
When this expires and if you haven't yet reached state retirement age, the UK will no longer support you and EU regulations ( 2004) state that you have no automatic right to be covered by another EU state health care scheme. Some countries may still be generous and allow you to continue to belong to the state system (paying contributions) Even then I would be very wary as local laws can and have changed very quickly.
Most EU countries now demand that to continue living legally in the country after the expiry of the E106 you need to get private health insurance.
(
this type of insurance is often impossible or prohibitively expensive for people with pre-existing conditions making it far more difficult than it used to be for people to retire early to an EU country, people living in another EU country also have no entitilement, except in an emergency, to health care in the UK, unless they move back permanently )
When you have lived in an EU country legally for 5 years you can then claim permanent residence status, (this may require a lot of cutting through red tape and officialdom) Permanent residence means that you are entitled to treatment on the same basis as a resident (I have this status in France and pay 8% of income for membership of the health care scheme)
Once you, or your spouse/partner, reach official retirement age and gets a state pension, then the UK takes on responsibility. In this case you have to once again apply for a form S1 (old E121). This isn't time limited like the version given prior to retirement age. Obviously if you are leaving the UK and are past official retirement age you will get health care covered on this basis from the start.
In all cases you might not get the same amount of coverage as in the UK though sometimes a 'top insurance' can cover these extra costs.