San Francisco CityPASS
And the choice of one of the following two sites:
You can visit all of these places over 9 days.
There is only one kind of CityPASS card, so you should be able to get a better deal the longer you spend in San Francisco, especially when using public transportation.
You can buy the CityPASS in the San Francisco Visitor Information Center on Market St. and Powell St. as well as in any of the included attractions.
If you would like to get a major discount, you can buy a card from the web page (you can also print the tickets directly from there):
However little you plan to use it, this card will be a good deal in most cases. The places included are some of the most important and the separate price of these together with a 7-day Muni Pass is over $130.