From our friends at GardensAlive.com
Fungus gnats are small, gray, midge-shaped flies approximately 1/4" long. They love moist soil, and soil rich in organic matter (peat moss, etc.). The larvae feed on young seedlings and this can kill a young plant, but rarely will harm an established plant. Adult fungus gnats can transmit plant disease, but mostly they are an unsightly nuisance.
Adult female fungus gnats deposit approximately 100 to 150 eggs on the surface of the soil close to the stem of the plant. The life cycle of the gnat continues as they hatch in 4 to 6 days into the larval stage, which feed on fungi, organic material and plant tissue for 2 weeks. The fungus gnat then pupates and emerges as an adult a few days later.
Reduce watering — fungus gnats love moisture — so, allow the soil to dry out, at least the top inch or so, between watering and then water infrequently.
Apply Bt— Knock-Out Gnats is a strain of Bt, which provides a very effective control of fungus gnats for houseplants and home greenhouses, use it as a soil drench.
Use Yellow Sticky Traps. These traps placed horizontally on the plant pot will attract many adults and the adult stage of many other small flying insects, thus another way to reduce the fungus gnat population.
With the above-mentioned Knock-Out Gnats you can interrupt the life cycle of the fungus gnat and greatly reduce, if not eliminate the unwelcome pest.