Fire fighters used special cutting equipment to free the man following the fall in Craigleath on Monday.
A spokeswoman for the Fire Service told the Daily Record: “We received a call shortly after 3pm to say a person had fallen off a roof and impaled on railings below.”
We were asked by ambulance to attend with cutting equipment before he was taken to the Edinburgh Royal Infirmary by Medic One.”