I have had some problems around that area.
Firstly, I always carry a 5mm Allen key so I can adjust my seat height during a ride, in case of such an "emergency". Simply put, if I strain the back of my leg during a ride, I'll drop seat a bit, just to get home, and if I hurt the front or front/side area of my knee, I'll pop the seat up a bit, just to finish the ride.
I'm no doctor, but......
If the discomfort is very close to, or right on the back of the knee joint (high on the calf or low on the hammy), it's most likely ligamental, and not muscular, so, if you can be bothered, you can ice the area (20-30mins should be enough).
I find that stretching my lower back CAREFULLY, and GENTLY on one those big rubber balls helps a lot with this part of the lower hammy/upper calf, but you've also gotta (obviously) try to stretch the hammys and the glutes.
It's tough to stretch the hammys when you're a bit sore in that area, so you've gotta stretch them by reducing knee extension while still getting plently of hip extension. I sometimes do this by (jeez, I'm a geek

) flopping my leg over the back of the couch (standing behind the couch), so that the middle/lower part of my hammy is resting on the top, rather than a conventional hammy stretch, where your foot is resting on something with your leg straight. Then, you bend over a bit, stretching the hammy with your knee bent. But if you're 6'17", you might have to find something higher to put your leg on.