The culprit is the flashing — the sheet metal that keeps the intersection between the chimney and roof watertight. When water gets behind faulty flashing, it can do a lot of damage to the roof sheathing and framing and to the ceiling below, so you need to deal with this problem immediately.
Proper flashing around a chimney includes two layers. The first is called step flashing: Sections of L-shaped sheet metal are woven into the shingle courses and lapped up the side of the chimney. Next comes the counterflashing: A second layer of metal is embedded in the chimney mortar joints and folded down to cover the top of the step flashing.
The corners are especially vulnerable. We cut and bend the metal around the corner. Even in a quality installation, this leaves one small spot that should be sealed with a high-quality urethane caulk. This caulk can work itself loose over time. If the flashing looks to be in good condition, recaulking should take care of the problem. However, caulk is not a substitute for properly overlapped flashing materials.
The type of metal used for flashing depends on where you live. Aluminum and galvanized steel are the usual choices in the South where I live. Copper is the longest-lived, but because it’s expensive, we see it only on high-end jobs here. Another advantage to copper is that the corners can be soldered for a watertight connection. In the Northeast, masons are partial to lead flashing, which is soft and easy to bend to shape. But no matter which material is used, it must be layered correctly if water is to be kept out.
When the chimney is at the bottom of a roof slope, we always install a cricket, a small diversion roof that prevents water from pounding the up-roof part of the chimney. We frame and sheathe crickets just like the rest of the roof, and then completely cover them with a modified bitumen membrane, which is folded up under the chimney flashing. We install asphalt shingles over the membrane to blend the cricket with the rest of the roof.