Los Angeles to San Francisco by BusMegabus runs from Los Angeles Union Station to the San Francisco CalTrain station (which is downtown), with seats sometimes as cheap as $1 if you reserve well in advance (but more often in the $40 to $50 range). The trip takes about 7.4 hours.
A convenient Shuttle Bus runs between Monterey Park (east of downtown LA) and San Jose, Cupertino, San Francisco or Oakland. There's only one trip offered a day, leaving in the morning from each place. Cost is about $80 to $110 round trip and it takes about 8.5 hours to travel between Monterey Park and downtown San Francisco.
California Shuttle Bus picks up and drops off at several locations on both ends of the route, departing at noon and midnight only and taking about 7.5 hours. They say fares start as low as $5, but most of them run more than that, with better rates if you book in advance.
Los Angeles to San Francisco by TrainThe Amtrak Coast Starlight line runs from Los Angeles' Union Station to San Jose or to Oakland's Jack London Square but does not go to the city of San Francisco. However, they do offer train/bus combinations that can get you there.
The Amtrak trip from LA to Oakland takes a little more than 11 hours and costs $60 to $70 one way. Some of their options include long rides on a bus (look for the little bus icon) and in some cases, you'll have to change conveyances twice to reach your destination.
You can also take an Amtrak train to San Jose, where you can transfer to Caltrain to get to San Francisco. This option will add a little less than $10 to your trip cost each way.