A:First test the sheetrock with a small pocket screwdriver. Using moderate pressure press at the stained areas. If the sheetrock gives in that section will have to be replaced. If it tests solid, it will have to be covered with a GOOD primer before you paint. The best primer for water stains is white pigmented shellac, such as Zinser. Zinser's white latex (water base) primer is another excellent choice, but you should give it two coats to prevent 'bleed thruough' of the stain. I've used other brands and they don't even come close to doing the same job.
regards