Open a window or turn on the ventilation fan. If you're working in a bathroom that's got neither of these, turn on a fan and point it out the bathroom door. Open nearby windows to carry out fumes.
Scrub the ceiling with a non-ammonia detergent and hot water. Rinse off the soap.
Mix one part trisodium phosphate (TSP) to two parts water in a bucket. Wear gloves. Clean the ceiling with this solution, especially if the mold is pretty advanced and you suspect that detergent alone won't do the job.
Rinse the TSP from the ceiling.
Mix 1 1/4 cups of chlorine bleach in 1 gallon of water. Sponge the bleach solution onto the affected area and let it sit for one or two hours before rinsing. You could also forego rinsing and just let the ceiling air-dry.
Prime the ceiling with stain-killing primer. Make sure the ceiling is completely dry before you prime. You might have to wait a day or two.
Paint the ceiling with mildew-resistant ceiling paint. Some paints are specially formulated for use in bathrooms, if that's where your mold problem is.