lobin
This is very similar to what i stated in the wikipedia link I posted andit is not as clear as TeamGB stated. Many Spanish citizens do not work (for many reasons), many have only ever worked on the black market, many don't have parents who are alive or working etc etc etc yet they get health care because they are a citizen of Spain and the same will apply if you are legally resident here and actively looking for work
One way around this is to ensure you are registered as unemployed and activley seeking work. In order to do this you would have to have residency status (either EU or non EU or Spanish)
The main problem is those early retirees who come to Spain without an income, not registering and working on the black market!
The amended law of 1986 is very clear about who gets healthcare including registerd foreigners. The 2012 change makes it a bit more diffcult to get registered as a permanent resident for foreigners but not impossible
As simple work around
Fo self employed (autonomo) for say 3 months, get registered, close business and sign on you should get health care maybe not benefts but there are some very minimal benfits available to some on a non contributory scheme 'Subsidio de desempleo' see link http://en.wikipedia.org/wiki/Unemployment_benefits_in_Spain
As you said it is not as black and white as some in the expat community seem to think
Other links
http://ec.europa.eu/employment_social/empl_portal/SSRinEU/Your%20social%20security%20rights%20in%20Spain_en.pdf
http://ec.europa.eu/social/main.jsp?catId=858
more info (there is so much on the net
Spanish Benefit System
If you have been employed (not for self employed autónomos) in Spain then you may be entitled to unemployment and incapacity benefits from the Spanish social security system.
Unemployment Benefit
If you have worked in Spain and your employer has paid contributions you can claim for unemployment benefit at your local Servicio Público de Empleo SEPE office. (www.sepe.es). You can also complete a CA3916 form to prove your contributions in the UK. ( National Insurance Contributions and Employer Office. Telephone: 0044 191 203 7010)
Disability Benefit
If you have worked and paid contributions in Spain you can claim for incapacity benefit at your local Social Seguridad office. (ww.seg-social.es). You can also complete a CA3916 form to prove your contributions in the UK. ( National Insurance Contributions and Employer Office. Telephone: 0044 191 203 7010)
Means Tested Benefit
If you have been living in Spain for at least five years, are aged 18-65 years old and have a low income or been affected by an illness / disability then you may be eligible to receive a non contributory invalidity benefit - Pensión de invalidez no contributiva. (www.imserso.es)
If you are aged over 65 years old and have been resident in Spain for over 10 years on a low income then you may be eligible for a non contributory retirement pension - Pensión de jubilación no contributiva. (www.imserso.es)