Sorry for your loss and glad it didn't burn down your house. You aren't the first and hopefully others can learn from this accident you are willing to share. It happens happens every year to someone, be it winter heat or baby chicks in the house. 
A good thing to do with all heat lamps is first make sure they are heat lamps and not just shop lights. A ceramic base is best, check for max wattage, then secure the light so well that there is no way for it to touch bedding even if you ran into it. If running one for extended periods of time, dust it off every once in a while, and don't put it too close to the water to avoid splashing a hot bulb with cold water. If at all possible, which is in most places in the US, insulate the coop and avoid heating it in the first place. Any time a portable heating solution is used, there is a risk of fire which many don't see.
Hope you can rebuild and join in on chickens again soon.