I get knee pain sometimes too, the other posters have the diagnosis (based on little- to no information) bang on. You might also want to let us know your age, and shape (pear, apple, or carrot).

Once I hit 30 I found my knees couldn't take the abuse any more. I started using trekking poles, a knee brace, lighter gear, more stretching, and better hydration, they all seem to have a positive impact. After 3 or 4 days of 20 milers I'll still get pain that won't go away until I rest for a few days though.
_________________________
http://lighterload.blogspot.com/