I returned from living in Spain 4 years ago having lived there for 6 years and yes we(my wife and myself )did take out residencia para extranjeros(foreigners).
If I remember correctly the first requirement is to have a residential address in Spain i.e. own or have a certified rental property.
The paperwork for registration/administration was carried out through the local towns(asssuming it is big enough) national police office. You will need copius copies of passports, photos,proof of address, birth certificates, marriage certificates etc etc.
I will have a look at the the site recommended by Ethel to see if I can add to that.
It is a good thing for your local area administration offices for you to be registered because you then come under their remit for EEC Grants. However don't forget that you will have to inform UK Tax Offices that you are now a Non Resident in UK. You can't have it both ways.