It is something that comes with plenty of practice, this is something I teach in Martial Arts.
A good goal is to learn how to fall into the bridge position (but please don't break your back!) This take a while to perfect and to prevent injury go at your own pace. If you can simply achieve one of the below steps then thats great.
Stretching is a great way to start off and even if at first you have to start this bridge position from the floor up do so until you feel strong enough to support yourself.
1. Start in standing position
2. Start of by practising a lean. Do this until you feel confident your back is adapting to its new found flexibilty.
3. Lean back further but only go as far as you feel comfertable. You will find with practise and time this will feel more comfertable as the muscles will stretch.
4. When you can feel your hands on the ground you have reached your goal. It ha taken me a while to get as flexible as I am today but remember I practice yoga everyday.
Flexiblilty will defintately benefit you in your older years so good advice is to start now! Plus it also makes a great party trick!...