SF actually has an abundance of reasonably priced office space. I don't know the medians, but a quick glance at http://www.rofo.com/CA/Mountain-View and http://www.rofo.com/CA/San-Francisco shows similar price to square foot ratios.
That said I'm super happy with workout out of the mission near the 24th street bart. And it's very affordable.