United Airlines and Star Alliance partners have San Francisco to Lisbon, Madrid and Barcelona tickets around $510 to $525 for departures February to May 2017. United flies you to London and TAP Portugal or Brussels Airlines gets you to Portugal and Spain or you can connect in EWR for all UA itinerary.
Keep an eye out for low-priced itineraries with a change of airport in London. It is definitely worth paying $20 more to avoid a London change of airport between LHR and LGW, which will cost more than $20 and take up several hours of transit time.
United Airlines SFO – Newark EWR – Madrid MAD – Brussels BRU – London LHR – SFO
But if you just want a really cheap ticket, then Momondo search shows TravelMerry.com tickets with American and British Airways at $402 for these same dates.
American Airlines/British Airways
SFO – Philadelphia PHL – Madrid MAD – London LHR – SFO
British Airways codeshares for AA operated flights
SFO – Philadelphia PHL – Barcelona BCN – Philadelphia PHL – SFO
United Airlines ticket SFO to Lisbon
SFO – London LHR – Lisbon LHR – Newark EWR – Washington IAD – SFO
You can save $100 on this ticket too buying an online travel agency fare with Oneworld flights. But if you look at the itinerary closely, this ticket will not be any savings at all with an overnight in London and an 11 hour layover in Dublin Airport with an arrival at 1am and departure 12:30 in the afternoon.
Pay close attention to the itinerary schedules when booking tickets. Dublin Airport has few bargain hotels.
British Airways/Aer Lingus online travel agency ticket
SFO – London LHR (overnight) – Lisbon LIS – Dublin (overnight) – SFO