In treating me for a hamstring injury late last year, my sports med doc emphasized that I needed to hold my hamstring stretches for a least a minute. As he explained, when you first start the stretch, your brain will first attempt to contract the muscle to protect it. For that reason, he said you needed to prolong the stretch to basically work past your brain's initial reaction.

My favorite hamstring stretch uses a yoga strap (or anything else that you can wrap around your foot. Lay flat on your back, lift one leg above your head and place the strap around your foot. Keep your back and head on the floor, along with the other hip (don't let it ride up). Hold the strap close to your foot on both ends and gentle pull your toes toward your head so that the stretch extends to the calf. Hold for at least a minute before switching legs.