Thanks daxr,
However it's not my hamstring that hurts. I'm not sure what the medical term for it, but it's the part just above the calf, and just before where the knee bends. I think you maybe right on flexibility. Maybe I should try more stretches just before going out to ride.