According to this web site (beijingholiday.com/transportation/beijing-lo…), you can get buses to Datong from the Liuliqiao Long Distance Bus Station. This station is about 1 km southwest of the Beijing West Rail Station, or 1 stop from the station on metro Line 9. Unfortunately, Line 9 does not yet connect to the rest of the metro lines, so the most efficient way to get to the bus station would be either to take one of the city bus lines listed in the linked web site (maybe your hotel or hostel can advise which of these bus lines is most convenient for you),
www.beijingholiday.com/ ...buses.html
EL horario de los buses!!