It is probably a moisture problem. We had this happen and we cleaned out our bathroom fan (it had all kinds of lint in it) and then we decided to just replace it, too. But, once the lint was removed it was blowing and circulating the air better up and out of the room.
Ventilate your bathroom and keep it drier by providing an outlet for unwanted moisture. One of the easiest methods to ventilate your bathroom is to open a window when you're showering or bathing. This allows the heavy water vapor to escape to the outdoors. Ceiling exhaust fans can also help to clear your bathroom from moisture-laden air. Clean and maintain your fan to keep it operating properly. Bathrooms located in more humid regions may benefit from a portable dehumidifier. Place a dehumidifier in your bathroom to extract moisture from the air and reduce the humidity level. These come in a variety of sizes to accommodate any bathroom size.
Scrape off any loose paint. Lightly sand the edges with 220 grit sandpaper to smooth them out. Prime with Kilz primer then paint with a bathroom paint.
Hi Cindy: William is right on. The key is to prepare the surface before painting. I wouldn't use a flat paint as that would absorb moisture. A semi-gloss or a satin would be best. You don't want anything too shiny as it will show every defect in the ceiling. Good luck