1. Caltrain which connects downtown SF to San Jose and Gilroy, notably bypassing both SFO and SJC airport [1]. This is a low frequency, mid-long distance commuter rail link that runs almost exclusively outside SF.
2. BART which connects SF to the East Bay, notably serving both SFO and OAK [2]. This is a medium frequency, larger train - think a hybrid of commuter and light rail. It's fast, long trains that run medium distances.
3. Muni Metro which is the SF subway and light-rail service. In the downtown corridor, all the major stations (from Civic Center to the Embarcadero) overlap with BART, but the trains continue out west into the Sunset [3]. This is high-ish frequency, smaller trains that (outside the downtown corridor) run overland.
[1] http://www.caltrain.com/stations/systemmap.html