Family members of EU/EEA/Spanish national
Under Directive 2004/38/EC and according to Real Decreto 240/2007, 16 February, family members of an EU/EEA national in possession of a valid UK Residence Card specifying its condition as a family member do not require a visa to enter Spain when travelling with the EU/EEA National or joining him/her in Spain. Otherwise, a visa will be still required (Real Decreto 1161/2009, 10th July 2009). For spouses or children of Spanish Nationals the above condition applies provided that the marriage or birth is registered according with the Spanish Civil Register (original Libro de Familia).
Please note, that the UK Residence Permit must state literally that the holder is a family member of an EU/EEA National. If not, a visa is required.