But before painting you need to clean all traces of the existing mold from the ceiling or it will come back. To clean try using a mold and mildew killer. You can find at the box stores in the paint dept. Follow instruction on bottle.
Most mold or mildew problems in bathrooms are caused by lack of ventilation. You should check that your fan is working properly, and make sure everyone is using it.