I'm sure others will chime in with more details and maybe even a link to a picture description, here are the basics:
Typically there is lead step flashing where the upper edge of it is inserted in between the bricks in the mortar joint. This step flashing then weaves into the shingle courses in the normal step flashing manner. Then, after all that, there is usually a "counter flashing" which is one solid horizontal sheet of lead that is embedded into the bricks above the step flashing. This counter flashing stops rain from sneaking into the top of the step flashing, as there is no siding to perform this function as on a typical house/roof juncture.
This is pretty critical stuff and you should not "wing it" if you are at all unsure as you will get a bad leak.