The other answers have covered the important ground, and are all things that have helped me, so I'll just add a few things from my own experience.
I have acrophobia, a balance disorder, and a number of physical injuries and illnesses that make it hard for me to go places and see things.
My husband, and the only other friend I trust, have found ways to help me do things I only dreamed of enjoying, so I'll suggest a few.
Hold on to your friend when they get scared. That may mean taking their hand, hooking arms, or wrapping your hand around their waist. Sometimes my husband just holds my coat or sleeve, and I feel better. Also, depending on the terrain, stand behind them so they know they can step or tip backwards and not fall over. A hand on my back really increases my confidence.
Some people with phobias just need to know they're not stuck, so remind your friend frequently that you'd be happy to take them back at any time. That can mean returning to a place they were comfortable and resting a bit, as others have said, or even going all the way back to the car or place you began. For me, that reassurance has often given me the strength I needed to keep going.
There have been times when I've had to force people to cut the journey short, and been afraid I disappointed them. I know you don't want your friends to feel that way, but just in case, let them know you've had a great time being together and watching them enjoy themselves, and that you'd love to take them again.
Recently, I went to Schoodic Point, which is a rocky section of the Acadia National Park in Maine. We stayed where it was fairly flat, without much climbing and no scrambling, but the terrain was rough and scary. It was something I thought I could never do, and planned to stay in the car. With my husband and friend using these methods, and what's in all the other answers here, I went much farther than I thought I would, loved almost every minute, and am looking forward to going back!
I look at the pictures from that vacation and still can't believe that was me up there! Caring for your friend in this way can make this kind of huge impact on their life!