Kickout flashing, which directs roof runoff away from a sidewall and into the gutter, must be installed under siding and roofing. In new construction, it requires the cooperation of both roofers and siders (the fine points of this cooperation are discussed at length in the JOURNAL OF LIGHT CONSTRUCTION forums). However, when a roof gets replaced, there's only one trade on the job, and it remains a detail that some roofers don't want to deal with. But if you don't, the damage can be disastrous (click the links on this page for some gruesome examples of kickout flashing gone bad).
Providing you're willing to open up the sidewall, getting it done right is not so hard, as this brief summary in Replacement Contractor describes. For a more detailed demonstration, Mike Guertin offers a thorough explanation in Fine Homebuilding.
Guertin relies on a Dryfleckt preformed diverter, but, of course, you can fabricate your own out of aluminum flashing (scroll for the photo series in this Contractor Talk discussion). The important thing it to make sure you make the diverter large enough to do the job. As Reuben Saltzman explains in the Minnesota Star Tribune, "cheesy installations" won't do the trick.