If the source is purely physical, standard sports medicine dictates the RICE formula:
+ rest
+ ice
+ compression
+ elevation
You want ICE on your knees for a good 30+ minutes after painful rides ... this will reduce inflamation.
http://orthoinfo.aaos.org/fact/thr_r...pcategory=Knee