Depending on how long you'll be in san francisco, I'd recommend the City Pass... it's one price of like $35 that gets you into the exploratorium, the academy of science, museum of modern art, palace of legion of honor (art museum), a boat ride
around Alcatraz, and a 7 day Muni (sf public transit) and cable car pass... it's a good deal, and you can buy it at any of those locations

(it's good for 9 days before it expires, but you can go to more than one thing per day if you want)