I did a google search on Edinburgh airport and bus service there is a 24 hour bus that leaves from the Waverly and Haymarket train stations to the airport here is the link:
http://www.flybybus.com/index.php?option=com_content&view=article&id=103&Itemid=182
Here is info from the airport's website
( http://www.edinburgh-airport-guide.co.uk/transport.html)
"Edinburgh Airport by BusThere are several regular bus services between Edinburgh airport and the city centre. The bus stands can be found in the front of the terminal building outside the UK arrivals lounge.
The number 100 bus is a regular shuttle which runs between the airport and the city (close to the bus and train stations and the high street.) This service runs 24 hours a day, 7 days a week, every ten minutes during peak hours and every half an hour off-peak.
A less frequent bus service operated by Lothian buses runs between the Ocean Terminal just outside the city centre, through the city and to the airport. This service runs from early morning until late at night; more details can be found on the Lothian buses website.
The information desk in the international arrivals hall also has access to bus timetables. For more information on planning your bus journey from Edinburgh airport, contact Traveline Scotland: Tel: 08457 484950 Website: Traveline Scotland"