I put my bags in the left luggage at the airport and caught the Metro into the centre of Madrid. The journey is approx half an hour. I walked around Puerto del Sol, down to the Palace, sat in the Park, then walked up to the Plaza Major, sat some more!! Went to eat, wandered around, went window shopping!!!!
You didnīt mention (I donīt think) what time of day your layover is, but remember the Metro stops running around 0130, after which you need a taxi back to the airport which can be quite expensive. You will be able to see a lot in 10 hours. Hope this helps!!!