In embodiments, an emergency lighting function may be integrated into an LED light bulb or compact fluorescent light bulb by integrating an LED light source and a power source such as a battery into the bulb where the LED light source and integrated power source operate on a detected power outage, bulb failure or any detected condition that may require the backup light source to be illuminated. In these embodiments, a processor or electrical circuit may be present to detect the outage and control the illumination of the backup light source in the bulb. The integrated power source may be rechargeable such as a super capacitor or rechargeable battery that would allow the storage of energy to be used during a power outage, bulb failure or any detected condition that may require the backup light source to be illuminated. The LED light bulb or compact fluorescent light bulb may operate independent of the backup light source integrated into the bulb. In embodiments of compact fluorescent light bulbs, the backup light source, power source and circuitry may be designed into the section of the housing containing the electronic ballast such that when the outage or failure is detected, the light source within the electronic ballast housing is illuminated. In some embodiments, a switch sense function may be integrated into the LED light bulb or compact fluorescent light bulb to add the ability of the emergency lighting function to be able to detect the state of controlling devices to allow the processor or electrical circuit to use the state of the controlling devices to decide on whether to illuminate the backup light source with the integrated power source. In embodiments that detect a bulb failure, there may be additional electrical circuitry which may monitor the primary light source to determine if there has been a failure of the primary light source. By way of an example, a current sensing may be implemented to determine if current is flowing through the primary light source. In a case where the primary light source has power applied but no current is flowing through the primary light source, the processor or electrical circuit may detect that as a failure of the primary light source. In an embodiment, a light sensor may be used to detect a failure of the primary light source (e.g., it may detect a light source outage).