the chimney is leaking. how should the flashing be installed down the side of the brick
It should be counter flashed. "L" shaped flashing under the shingles and up the brick and top flashing bedded in the chimney mortar down over the shingle molding.
Chimneys can leak a number of other ways, though.