Preparation is very key when you go to paint. Painting, itself, is the easy part.
First, remove what 'bad paint' there is that you can. Then, wash the ceiling with TSP. Be sure to rinse well as the 'powdery residue' left behind needs to be washed off. (IF it's not, the paint won't adhere.) Then, sand the rough edges, and clean off the ceiling again. Then spackle the 'rough edges' of where the remaining paint, and sand and clean, if you must. Then PRIME, then paint.
Just to put this in perspective, it's quite possible that had you preped the ceiling with a washing of TSP, and rinsed well, then all you would have had to do is prime, and topcoat. Unfortunately, you have a little more work to do since it's all, how would you say, 'water over the dam'. My best to ya and hope this helps.