To repair a leaking roof valley, take the shingles off the roof, and attach the flashing onto the surface under the valley. Coat the flashing with caulk, and place the shingles back on the roof. Carefully examine each shingle before reattaching it to make sure that it isn't damaged. Replace all the damaged shingles with new ones. After all the shingles are in place, apply a layer of roofing tar on the roof, and let it dry.
Before starting to repair the roof valley, find out where the leak is located and what caused it. The most common reasons for a valley to leak are cracks in roof shingles around roofing nails. The water has enough space to run down the nail and drip under the surface of the roof. It may be a lot of trouble to remove all the shingles from the roof to conduct the repair, so measure the flashing to find out which shingles you need to remove, and remove only those ones. It may also be a good idea to remove some extra shingles on the sides to ensure better roof protection by the flashing.
Use screws to attach the flashing to the roof at the top and bottom. Another way of attaching the flashing is by using caulk. Be careful not to damage the flashing when reattaching shingles, as you are going to use nails to do that.