During the long and dark days of high school, I learned many pen tricks to entertain myself. For someone as fidgety as I, these have proved life-long sources of distractiony goodness.
They are (I'm making up names now...): The Rise, and The Twirl
Step 1: The Rise: Positioning the pen
Place the pen between your middle and ring finger, and rest the end in the soft tissue between your index finger and thumb. If you're using a pencil, or an evenly weighted pen, you can use either side, but if one end of the pen is heavier than the other, make sure the heavy end is sicking out beyond your hand.
Step 2: The Rise: Beginning the flip
This is where things start to get tricky.
Push downward on the pen with your middle finger, until enough pressure is built up that the point or end slips from where it rests between your index finger and thumb. When it releases, the pen will rocket downwards.
Step 3: The Rise: Continuing the flip
If you continue to push down with your middle finger (little pressure is necessary at this point), the back (heavy side) of the pen will eventually come up against the outside part of your outstretched index finger. Done rapidly enough, the combination of weight and momentum will cause the heavy end to bounce off your index finger, and drop down towards the knuckle of your middle finger. Gravity will cause the heavy end to drop further down the outside of the hand, and the pen will pivot between the 2nd joints of your middle and ring fingers. Momentum will carry the front of the pen up and over your middle finger, where you can capture it again between your middle and index fingers.
Step 4: The Rise: Getting fancy
Because the pen returns to the same position, but between the next set of fingers towards the thumb, it can be chained to start from between the pinkie and ring fingers. You simply does the same steps as previously mentioned, but cycle everything down (i.e. index becomes middle, middle becomes ring, and ring becomes pinkie).
Step 5: The Rise: Putting it all together
And here's the video of the whole motion.