The ceiling is first primed with a Primer/Sealer to prevent the dried waterstains from 'bleeding' through to the finished surface. Then, popcorn is 'feathered' on top of the damaged area.
OR, the damaged area can be removed first. Then, the unfinished ceiling is Primed/Sealed. Then, new popcorn is added and feathered into the 'old' part of the ceiling. Then, it may need to be painted.
This is one of the 'downsides' to having your particular type of ceiling. Sometimes, it can be costly for simple repairs. Depending on how old the popcorn is, it MAY contain asbestos. Contact your local Health Department for guidance on this.