I have to recommend the following site :
http://www.hotwire.com
Through this site, I stayed at
Hotel Monaco, a really cool 4* boutique hotel just off Union Square for just under $100 a night for 2. Rack rate was $260.
What's the catch? You don't get to choose the hotel.
You specify general location (you can get pretty specific within SF) and no. of stars. You'll get details of all the facilities in the hotel, but not the specific hotel. Then you have to pay for it.....before you know the name of the hotel!!
I was a little nervous, but US relatives use this site a lot and have never been given a dud. 4* really is 4*. The only other complication is that if you cancel, there's no refund. Make sure your travel insurance is up-to-date!
I think the trick is that they sell the surplus stock of hotels which the hotels themselves know based on their own models that they won't sell. However, by not revealing the name until you're committed, they don't undermine their own markets and channels.
Whatever the trick is, you can stay in a much better class of joint in downtown SF for reasonable money. You just need a little nerve.