There are 2 types of recessed lights, Standard and I.C. rated. I.C. rated lights have a thermostat inside them that will kick off at a predetermined temperature. The wattage of the light you use in these lights is critical but the type of bulb you use is also critical. They must be a reflector type light and the lower the wattage the less heat build-up you will have. You might even consider not using a halogen bulb as the halogens generate more heat than a standard incandescent. A compact florescent may work but the fixture has to be rated for the type of bulb you use.
Standard recessed lighting doesn't have the thermostat. So, if you have a standard recessed light that turns itself off and comes back on on it's own, your house may very well be haunted