A brown ring on the ceiling doesn't always mean the roof failed. Water can come from inside the house too. If the shingles and flashing check out, these are the usual suspects:
The trick is matching the stain to the cause. Timing and location tell you most of what you need to know.

Here's the thing: in a Chicago winter, warm, damp air from your living space rises into the attic. It hits the cold roof deck and turns into frost on the wood and on the tips of the roofing nails.
Then a warm day comes along. All that frost melts at once and drips onto the insulation and drywall. Homeowners see stains after a thaw, with no rain at all, and assume the roof is leaking. (It's not. It's raining inside the attic. Who would've thought?)
Signs it's condensation:
The fix is better air sealing and ventilation, not new shingles. Here's how to prevent roof condensation problems, and why roof venting matters so much.
Every bath fan should push air all the way outside through a roof cap or wall cap. Plenty don't. Some ducts were never connected, some slipped off, and some just end in the insulation.
A single hot shower sends a surprising amount of moisture into the attic. If your stain sits near a bathroom fan, or the stain grows in winter, check that duct first. It's one of the cheapest problems on this list to fix.
A stain right under a bathroom, a laundry room, or a run of pipes points to plumbing. Supply lines, drain lines, toilet seals, and tub drains can all drip slowly for months.
Plumbing stains don't care about the weather. They grow on dry days, too. Quick test: turn off every faucet and appliance, then watch your water meter for 30 minutes. If it moves, water is going somewhere it shouldn't.
Many homes have an air handler or furnace in the attic. Those units make water, and that water drains through a small line and a pan. When the line clogs with algae or the pan rusts through, water spills onto the ceiling below.
These stains usually show up in summer when the AC runs hard. They often line up with the unit or follow the path of the ductwork. Sweating ducts with poor insulation can drip, too.
Sometimes the stain is just history. The roof or pipe got repaired, but the ceiling was never treated. Water stains bleed through regular paint, so a quick touch up won't hide it.
If the spot is dry, hard, and hasn't grown in months, it's likely an old stain. Seal it with a stain blocking primer, then repaint.

Alright, let's put it together. Use timing and location to narrow it down:
Next, grab a flashlight and look in the attic right above the stain. Wet insulation, water trails on the rafters, and frost on nails all tell a story.
Of course, sometimes the roof is the problem after all. Leaks don't always come from missing shingles. The most common spots are:
Winter adds one more twist. Snow that melts and refreezes at the cold edge of the roof can form an ice dam. The meltwater backs up under the shingles and leaks near the outside walls, even on a roof that's perfectly fine in summer. That's why codes in our area call for ice and water shield along the eaves.
One more thing many people miss: water can run along a rafter for several feet before it drips. So the stain may be nowhere near where the water got in. Here's how to find a roof leak, plus the classic signs of a leaking roof to watch for.
Broad ranges for planning, not quotes:
Textured ceilings cost more to patch, because matching the texture takes time. (A bad match can stand out more than the stain did.)
Most of these fixes are quick once you know the cause. A duct reconnect or condensate line cleaning takes an hour or two. A roof flashing repair is usually a half day. Drywall work takes two to three days, since each coat of mud needs time to dry.
The part that takes longest is drying. Don't paint until the area is fully dry, or the stain comes right back. If the drywall is soft, sagging, or smells musty, replace that section instead of painting over it. Damp drywall and insulation can grow mold within a day or two.
Also, take photos and write down dates before anything gets fixed. If this ends up being an insurance claim, that record matters.
A stained ceiling with a healthy roof usually comes down to condensation, a bath fan, plumbing, the AC, or an old stain. Match the stain to its timing and location, check the attic, and fix the source before you paint.
What should you consider next? If the stain shows up after rain or snow, or you can't find another cause, have a roofing company inspect the roof and attic together. Finding the real source now is a lot cheaper than repainting the same ceiling twice.