Proper fit ?
Are you sitting to high/low forward/back...Google proper bike fit or better yet go to a shop and have them look..
Mashing or spinning the gears?
You wanna be spinning at about 80-90 rpm...If your having to mash hard on the pedels to maintain a constant speed you will get pain...This was my problem when I started , so much that I could barely kneel after a ride and getting up from the kneel required a assist..
Pedaling with Toes, balls or arch ?
Ideally you should be pedaling with the balls of your feet..
My toes point outward, much more then the average person's. This resulted poor pedaling technique. My knees bent out to the sides when my feet would come to the top of the stroke. This caused a pain in my knee on the out side of the joint; similar to what you described. I rested the knee. Once it stopped hurting and with a bit of focus I was able to keep my knees together and pumping straight up and down. The pain did not return. Poor pedaling technique may or may not be the cause ou your problem but it's something to look into. The big thing to remember is DON'T PUSH IT. When it comes to joints, if it hurts.... stop.
You may have a muscle imbalance because of a poor fit. Knee problems often occur only after a few bouts of hard training and often go away after rest. Other than making fit adjustments, you may want to consider stretching and massage, even a professional massage, to help relax the offending muscle. For many people, including myself, occasional knee problems are caused by tight illiotibial bands (IT-bands). Google it for more info.
Thats your ITB's mate. Foam rollers are great for that. Maybe "the stick". Get a bike fit done, correct pedeling, maybe your feet are too pointed inward. See an osteo or chiro or physio. Maybe your hamstrings are weak compared to your quads, inner quadracep (vestus medius) stregth may be prescribed, maybe multi tracking, maybe lack of stretching, no 5-10 minute cool down, too much too soon, maybe a sharp increase too quick.
Pro bike fits are great but dont forget that if you have a current knee issue lowering the seat may help. Stretch all leg muscles before and after your rides and when not riding. Rest, ice.
The only thing that I can think it could be is your IT band. ITB syndrome is very commonly seen in cyclists. Due to the motion your legs make while cycling, your ITB is repeatedly forced back and forth across the lateral condyle of your femur, causing friction and inflamation. It is also associated with the muscles of the thigh that insert into the ITB (the hip abductors). Since you say you are out-toed a bit, id say youre a pretty textbook case of ITB syndrome. Strengthening of these muscles as well as stretching generally help, as well as rest. Id say if it only happens during cycling, get a professional fit, as this could very well be the rest you need from the aggrivation. if you dont see much of any improvement soon, id get it looked at
I know what you are talking about cause I experience the same pain and riding isn't my only problem. I have found nothing to help me at all and as soon as I can stretch out I can resume again. When I'm training and began getting that pain of staying in that postion for too long and I let my legs hang down out of the stirrups. I also do this everytime before I get out of the saddle or I will fall right to my knees from the stiffness. I can't even sit in a car too long or chair without getting uncomfortable. I have very bad arthritis in my hands also so holding a twitch for too long or pulling manes or writing etc etc will cause stiffness and sever pain between my thumbs and first finger. I can always gurantee the next morning I will be crippled so I have to watch what I do. I have found bigleoil ro relieve me some and its made by absorbine. Give it a try! It won't hurt you