I used to have knee pain on my old bike - both behind the knee and what felt like under the bottom of the knee cap.

It was from two things for me (back of knee pain) - weak hamstrings, this one I fixed by doing very light weights on the leg machine at the gym (I cant recall what it is called) that you lie on your stomach with the weights on the backs of your legs bend at the knee towards your butt. I really really had to be careful to not agravate it doing this. I started out with no weight, just the plate and worked up over about a month - but still not with much weight. I think I may have topped out at 30 lbs or less.

The other thing that caused (under knee cap pain) it was a bike that was too long. It probably had cranks that were too long too, but the stetched out position meant I wasn't using my thigh muscles the way I should have been and it was really stressing my knees.

The only thing that used to make them feel better for me was support - wrapping them up in ace bandages, but now that I have a bike that fits and I've paid attention and strenghtened those hammies I don't get any more knee pain at all.