This is a pretty easy trick but you have to get a feel of how fast the rail slides first. You have to know how to Ollie and F/S 180.
Ride toward your target at a pretty fast speed but be comfortable with it. Ollie up over you rail do a 90 and push you feet down when your onto of it. Then be ready to slide. Slide until your close to the end. Then when your about have a foot away from the end do a 90 then just slide out. Its a fun trick to do on rails but on ledges its a bit too easy. Come at a 45 degree angle if you find coming parallel with it is too hard.Shove out is below.
To do this it would help to know how to do a BS Boardslide to fakie. There must be an end to the pole and you must be able to get on both sides. 1.Get on to the rail and slide. 2.Make sure you are well balanced. 3.When you get to the end shove the board 90 degrees and do a little body varial to land on your regular position (Goofy or Regular) 4.Ride away and look cool while you get mad props.
[fs boardslide]
You should be pretty good at skateboarding before you try this trick. You have to know how to b/s Boardslide first.
Come up to your rail and do a 90 do it at a pretty fast speed. At first when you try you will probably stop on top of the rail or slide a little bit. You will learn how much to lean after about 10 tries. Then just keep practicing and you will get it. Its not so hard if your B/S Boardslide is mastered. Then when you are trying to come out of it just do a 90 and you should be fine. You can learn cool stuff like shove-it outs and things like that but whatever.