Renfe is Spain's national railroad. The main station for all trains—high speed AVEs, long and medium distance trains and local trains—is Barcelona Sants, although in the future the crown will be shared with Sagrera on the north side of the city. The beautiful old França station will still be used for some services.
Renfe also serves Barcelona's outlying districts on a network known as the Rodalíes, radiating out of Plaça de Catalunya, which come in handy for short day trips outside of the city or reaching the airport.
The Rodalies are part of the integrated fare system that includes the metro and bus and tram lines; you can use passes such as the T-10 and Barcelona Card on them, although you'll have to pay more if you venture out of zone 1.
Note that only long and medium distance tickets can be purchased on line. Medium and local tickets are purchased in the machines at the stations. Chek out Seat61, an excellent source of information on all aspects of riding trains and buying tickets in Spain.
Image by Bonaventura Leris