Amtrak trains travel to the Bay Area from some cities in California as well as the greater United States. The Coast Starlight travels north from Los Angeles to Seattle, passing the Bay Area along the way, but contrary to its name, the train runs inland through the Central Valley for much of its route through Northern California; the most scenic stretch is in Southern California, between San Luis Obispo and Los Angeles. Amtrak also has several routes between San Jose, Oakland, and Sacramento. The California Zephyr travels from Chicago to the Bay Area, with spectacular alpine vistas as it crosses the Sierra Nevada range. San Francisco doesn't have an Amtrak train station but does have an Amtrak bus stop at the Ferry Building, from which shuttle buses transport passengers to trains in Emeryville, just over the Bay Bridge. Shuttle buses also connect the Emeryville train station with BART and other points in downtown San Francisco. You can buy a California Rail Pass, which gives you 7 days of travel in a 21-day period, for $159.
Caltrain connects San Francisco to Palo Alto, San Jose, Santa Clara, and many smaller cities en route. In San Francisco, trains leave from the main depot, at 4th and Townsend Streets, and a rail-side stop at 22nd and Pennsylvania Streets. One-way fares are $3.75 to $15, depending on the number of zones through which you travel; tickets are valid for four hours after purchase time. A ticket is $8.25 from San Francisco to Palo Alto, at least $10.50 to San Jose. You can also buy a day pass ($7.50–$30) for unlimited travel in a 24-hour period. It's worth waiting for an express train for trips that last from 1 to 1¾ hours. On weekdays, trains depart three or four times per hour during the morning and evening, but only once or twice per hour during daytime non-commute hours and late night. Weekend trains run once per hour, though there are two bullet trains per day, one in late morning and one in early evening The system shuts down after midnight. There are no onboard ticket sales. You must buy tickets before boarding the train or risk paying up to $230 for fare evasion.