First and most important step is to fix the source of the stain. A quick tips is to dab or spray the stain with straight bleach, be sure to to drip on any other surfaces to prevent bleach damage. Use safely glasses and gloves etc. I have used this quick method with good success on smaller stains.
Step 1 Repair the Leak
Before you remove the stain, you will have to repair what is causing the stain. In most cases, the cause is a water leak or the collection of water on your roof.
Step 2 Getting Ready
Place a plastic sheet below the stained area. Using a stepladder, clean the stained area with a damp rag. If you find any mold, use bleach and water to remove it.
Step 3 Analyze the Stain
If the stain is small, simply dab some bleach (mixed with water) on the area till stain disappears.
Step 4 Apply a Stain Blocker
If the stain is large, use a pigmented stain blocker (such as Kilz or Bullseye) to cover the stain. To apply the stain blocker, use rollers for smooth surfaces and brushes for corners. Allow the ceiling to dry for at least 24 hours.
Step Paint
Once the pigmented stain blocker has dried, simply apply matching ceiling paint over the area. Let it dry and repeat this process, if needed.