Approach the rail with the rail between your legs. This is very important, I see so many people trying to get on rails approaching them from the side, this will NOT work.
Be sure that your speed is good to get both your skis onto the rail and off the other end. Remember the slower you go the longer you spend on the rail!
Hop off the jump or transition, turn 90 degrees, and land on the rail square with the rail directly under the center of your boot sole. KEEP YOUR HANDS UP IN FRONT OF YOU.
Focus on the end of the rail, this helps to keep your weight forward and keeps you from falling off the rail to the sides.
Try to ride off the rail, straighten your skis downhill and stomp it out. You just cleaned the rail, and you still got your jewels...