The city has a cheap and efficient commuter train line, the Ferrocarrils de la Generalitat de Catalunya (FGC ), with its main stations at Plaça de Catalunya and Plaça d'Espanya. You'll use this going to Montserrat and Tibidabo; it's also useful for reaching towns outside the city limits and details are given in the text where appropriate.
RENFE, the Spanish rail company, operates an horrendously complicated variety of train services. An ordinary train, much the same speed and cost as the bus, will normally be described as an Expreso or Rapido. Semi-directos and Tranvías (mostly short-haul trains) are somewhat slower. Intercity expresses, in ascending order of speed and luxury, are known as Electrotren, Talgo or Pendular . The latter two categories are the most expensive, costing as much as 60-70 percent more than you'd pay for a standard second-class ticket; Electrotren tickets cost 40-50 percent more. There's a whole range of discount fares available for those over 65, travelling with children under twelve, in a group of eleven or more, or planning a day return, so make it clear to the clerk exactly what you're planning.
Tickets can be bought at the stations between sixty days and fifteen minutes before the train leaves from the venta anticipada window, or in the final two hours from the venta inmediata window. Don't leave it to the last minute as there are usually long lines. There may also be separate windows for Largo recorrido (long-distance) trains and Regionales or Cercanías (locals). You can also buy tickets and make seat reservations at travel agents which display the RENFE sign; the cost is the same as at the station.