What kind of stain are you talking about? Do you mean that it has a colored stain like the colored stains like the Minwax or other commercial stains? Or do you have the white paint applied and mostly wiped back off that was so common with knotty pine in the 1950's? Or do you mean a water stain that can be anything from a combination of white staining in an area mixed with dirt that has migrated to the outsides of the affected area or black stains that are the result of wood being subjected to water for a long time or heavily and frequently? And if it's water staining is it from a leaky roof or is it from leaky plumbing? If it's either of these, the first thing to do is get the leak sealed.
Let us know what kind of stain you have and what you want your ceiling to look like.