If I were traveling from Madrid to Sarria I would take the Renfe train from Chamartin station. (enter Madrid(*))
Renfe
http://www.renfe.com/
Other options include taking an ALSA bus from Madrid Estacion Sur or Airport T4 to Lugo and a Monbus bus from Lugo to Sarria. (enter Madrid(*)) The bus takes a lot more time but there is more flexibility due to frequency of service.
ALSA
http://www.alsa.es/en/
Monbus
http://www.monbus.es/es
I would consider taking a flight to Santiago airport, take an Empresa Freire bus from the airport (Labacolla) to Lugo and a Monbus bus to Sarria. The flight may or may not be cheaper than taking the train from Madrid.
Santiago Airport
http://www.aena.es/csee/Satellite/Aeropuerto-Santiago/es/
Empresa Freire
http://www.empresafreire.com/html/castelan/seccion0.php
See the following generic stuff regarding transportation in Madrid.
2000 Madrid
2001 This section discusses transportation services in Madrid.
Index 2000
2002 Madrid Airport
2003 Getting Around in Madrid
2004 Train Service Madrid
2005 Madrid Train Stations
2006 Madrid Airport to train station Puerta de Atocha
2007 Madrid Airport to train station Chamartin
2008 Bus Service Madrid
2009 Madrid Bus Stations
2010 Madrid Airport Access to Bus Station T4
2011 Madrid Airport to Bus Station Avendida de America
2012 Madrid Airport to Estacion Sur de Autobuses de Madrid
2013 Madrid Airport to Bus Station Moncloa
2002
Madrid Airport
The airport in Madrid is called Adolfo Suárez Madrid-Barajas Airport (MAD). There are 4 terminals. T1, T2, and T3 are in one building while T4 is connected via shuttle. Terminal 4S is connected to Terminal 4 by Automatic People Mover (APM) and has a shuttle stop.
Madrid Airport (MAD)
http://www.aena-aeropuertos.es/csee/Satellite/Aeropuerto-Madrid-Barajas/en/
2003
Getting around in Madrid
Connections to Madrid include subway (Metro), light rail transit (Cercanias), and bus (EMT).
Madrid Metro has stations at T1-T2-T3 and at T4. The trains run every 6 - 12 minutes.
Madrid Cercanias has a station at T4. The trains run every 30 minutes.
Empresa Municipal de Transportes (EMT) route 200 provides bus service from the airport T1-T2-T3 and airport T4 to Intercambiador de Avenida de America, a major urban bus, intercity bus and metro connection hub.
EMT Madrid Aeropuerto Express operates a bright yellow express bus every 13 -20 minutes from the airport T1-T2-T3 and airport T4 to Puerta de Atocha Renfe station.
Madrid Metro
http://www.metromadrid.es/en/index.html
Madrid Metro Map
http://www.metromadrid.es/export/sites/metro/comun/documentos/planos/Planomayo2013.pdf
Madrid Cercanias (operated by Renfe)
http://www.renfe.com/viajeros/cercanias/madrid/index.html
EMT Madrid provides Madrid transit bus services
http://www.emtmadrid.es/
EMT Madrid Aeropuerto Express
http://www.emtmadrid.es/lineaAeropuerto/index.html
2004
Train Service Madrid
Renfe operates Spain's national train network.
Renfe
http://www.renfe.com/index.html
2005
Madrid Train Stations
Madrid has two major Renfe train stations operated by adif; Puerto de Atocha and Chamartin.
Chamartin Renfe Station Madrid
http://www.adif.es/es_ES/infraestructuras/estaciones/17000/informacion_000295.shtml
Puerta de Atocha Renfe Station Madrid
http://www.adif.es/es_ES/infraestructuras/estaciones/60000/informacion_000070.shtml
2006
Madrid Airport to train station Puerto de Atocha
a. Puerto de Atocha is reached by Metro. Take line 8 from airport T1-T2-T3 or T4 to Nuevos Ministerios; line 10 to Tribunal; and, line 1 to Renfe Atocha.
b. Puerto de Atocha is reached by Renfe Cercanias direct from Madrid Airport T4
c. Puerto de Atocha is reached by EMT Madrid Aeropuerto Express direct from Madrid Airport.
2007
Madrid Airport to train station Chamartin
a. Chamartin is reached by Metro. Take line 8 from airport T1-T2-T3 or T4 to Nuevos Ministerios; and, line 10 to Chamartin.
b. Chamartin is reached by Renfe Cercanias direct from Madrid Airport T4.
2008
Bus Service Madrid
There are hundreds of bus companies in Spain. Usually the best tactic is to refer to bus station information at your destination for listings of bus service providers and schedules.
ALSA is a major bus carrier with service to Madrid.
http://www.alsa.es/en/
Avanza bus is a major bus carrier with service to Madrid.
http://www.avanzabus.com/web/default.aspx
2009
Madrid Bus Stations
There are several bus stations in Madrid. I've listed four. There likely are other stations that I'm not aware of at time of writing.
There is a bus station at Madrid Airport T4. See Transport and Access tabs.
http://www.aena-aeropuertos.es/csee/Satellite/Aeropuerto-Madrid-Barajas/en/
Estacion Sur de Autobuses de Madrid
http://www.estacionautobusesmadrid.com/frameset.html
Intercambiador de Avenida de America
http://es.wikipedia.org/wiki/Intercambiador_de_Avenida_de_América
Moncloa
http://es.wikipedia.org/wiki/Estación_de_Moncloa
2010
Madrid Airport Access to Bus Station T4
There is a bus station at T4 Barajas Airport. A shuttle connects T1-T2-T3 with T4.
2011
Madrid Airport to bus station Avenida de America
a. Intercambiador de Avenida de America (Madrid) is co-located with the Metro. Take line 8 from Barajas airport T1-T2-T3 or T4 to Colombia; and, line 9 to Avenida de America.
b. EMT route 200 provides bus service from the airport T1-T2-T3 and airport T4 to Intercambiador de Avenida de America.
2012
Madrid Airport to Estacion Sur de Autobuses de Madrid
a. Estacion Sur de Autobuses de Madrid is located near the Méndez Álvaro Metro Station. Take line 8 from Barajas airport T1-T2-T3 or T4 to Colombia; line 9 to Avenida de America; and, line 6 to Méndez Álvaro. Exit the Metro to find the bus station.
b. Take Renfe Cercanias train from T4 Barajas airport to Méndez Álvaro.
2013
Madrid Airport to bus station Moncloa
Madrid Moncloa is co-located with the Metro. Take line 8 from Barajas airport T1-T2-T3 or T4 to Nuevo Ministerios; and, line 6 to Moncloa.