What is the best way to get from Santiago de Compostela to Madrid?

Map of Spain

The question was:

How difficult is it to get back to Madrid from Santiago de Compostela? I was thinking bus, but not too sure about a 7-hour bus ride. Looks like plane tickets are really cheap, but I don’t want to buy in advance, because I’m not sure exactly when I’ll be arriving in Santiago.

Read all the good travel recommendations from Santiago de Compostela to Madrid from our veteran pilgrims in our Camino de Santiago forum.