You can now do this online. Here´s how:
If are registered in the Spanish social security/healthcare system, your British EHIC card has expired and you are not yet in receipt of a state pension, you can get the Spanish equivalent, Tarjeta Sanitaria Europa, This enables you to receive free emergency health care while visiting any EU country (including the UK).
NB If you are in receipt of a UK State Pension you need to apply to the UK Pensions department for an EHIC card, not this site.
You will need your NIE number and your 12 digit social security number.
Google "solicitud tarjeta sanitaria europa sede electronica" (the system won't let me post the link but the URL begins SEDE SEG SOCIAL GOB ES)
Click Solicitar/Renovar Tarjeta Sanitaria, bottom right
Enter your name and address details. You can apply for other members of your family too. Make sure you put your address in the first section, Residentes en España,, not in Residentes fuera España. Enter your SS number in No. affiliación SS, with the first two digits in the first box before the dash, then the remaining 10 digits in the second box.
Select NIE where it says Tipo de Identificación. When entering the NIE, put a zero instead of the first hyphen and leave out the second one, e.g. if your NIE is X-123456-X, put X0123456X
Click Aceptar, and Roberto es tu tio.