When you start having little aches and pains that occur on the bike one thing to look at is bike fit. For athletes that spend multiple hours at a time on the bike it's imperative that you get a professional bike fit. The money you pay is well worth the aches/pain it saves your body and is probably cheaper then seeing someone like myself to routinely fix those said aches/pains.
When someone comes in with a recurring type problem that only shows up with cycling vs say running, I always ask when your last bike fit was. 70% of the time, a qualified bike fitter, gets rid of the problem. It's somewhat like chiropractic/manual therapy. Fix the source of the problem, not just the symptom. That being said, here's a few great tips for the recreational rider with some aches and pains on the bike.
1. If a saddle height is off by being too high this can cause posterior knee pain and having a saddle too low can cause anterior knee pain.
2. Saddle position in terms of fore and aft. Simply nose pointing down or up. If it's pointing down, it can shift the hips forward and cause general knee pain. Having the nose pointing slightly up can cause the lumbar spine to be under stress and give low back pain.
3. Pedal position should be right over the ball of the foot, which should be right over the front of the knee. If this is off, you will be not be using your muscles optimally.
For a great article on bike fit read THIS. It's got a lot of tips on seat angle, crank length, cadence, all towards what has been shown to maximize VO2max and muscular power.