There are several answers to why bulbs might burn out prematurely. The ones that don't involve any particular hazard (beyond tripping over things in the dark!) are quality control and vibration.
Once in a while even reputable brands of light bulbs may have a bad batch of bulbs. This may be evidenced by many or all of a batch of bulbs that were bought at the same time failing very quickly in lights that have not given any trouble before. If this happens you may be able to return them to the retailer.
Vibration kills even good light bulbs by stretching the hot filament. You may notice the bulb get brighter following an impact or vibration of sufficient force to shake the bulb. The bulb gets brighter because the stretched and now thinner filament has a higher resistance and the bulb burns hotter and brighter. The extra heat dramatically shortens the life of the bulb. Continued impacts or vibrations hasten the process.
If you have a particular light fixture where bulbs burn out quickly, consider what goes on in rooms adjacent or above. Do the kids rough-house in rooms above the troublesome light? Or is the light beside a frequently slammed door? If vibration may be the cause of bulbs failing, try rough service bulbs which are designed to handle some knocking about.
A third cause of premature bulb failure, and one that is potentially hazardous, is use of the wrong type and/or wattage of bulb.
All fixtures should have the proper type and wattage of bulb indicated somewhere on the fixture. A very common rating in ceiling fixtures is “Type A” at 60 watt or 40 watt maximum. A type A bulb is the everyday light bulb that most of us think of when we think of a light bulb. Potlights or tracklights typically take 75 watt R-40,R-30 or PAR-30 bulbs (rating example). These maximum watt ratings for a given bulb type must be adhered to or dangerous overheating may develop in and above the fixture. If bulbs are burning out abnormally quickly or a burning smell is noticed, check whether the bulbs in the fixture are correct.
Wondering what those numbers mean? R40, R30, A19 and the fluorscents T12, T8, T5? The letters refer to the type of bulb, while the number gives the bulb diameter in eighths of an inch.
Good quality compact fluorescent bulbs can help if you are experiencing short bulb life (or even if you're not). They produce much less heat, have no filament to break, last much longer than incandescent bulbs like the type A or R and save energy as well! Their use is widespread in some countries such as Cuba and Venezuela. In Australia legislation has been introduced to eliminate incandescent bulbs in most applications over the next few years.
An even better choice these days may be light emitting diode (LED) bulbs. Recent advances in LED technology have made reasonably priced LED replacements available for a variety of bulb types and even for fluorescent tubes. LEDs are currently the ultimate in lighting efficiency and they have extremely long life. You may never change a bulb again!