I assume there's already a roof in the desired position? If not it's easier to add the roof in before extending the wall (you could draw a polyline and ROTATE3D to mimic the profile of the roof if you need to do the wall firsty, though).
Select the wall and right click.
Click Roof/floor line
Select "Modify Roof line" then
Select the roof.
If you've gone the polyline roof ou need to "project to polyline" rather than autoproject.