Knees may ache due to improper gear selection while driving. Tightening and breaking, selecting difficult gears.
Learn to use the correct cadence. Rotate at least 60-70 rpm. The first time is unusual, but then you will get pleasure from the ride and forget about pain in your knees.
Incorrect pedaling - through force. Incorrect seat height - the leg does not straighten almost completely when pedaling, or vice versa, it straightens too much.
If the case is not neglected, then the leg muscles are strengthened. In no case are full squats, when the leg is fully bent at the knee. Basically, strengthening the muscles of the thighs, which will prevent narrowing of the joint space of the knee.
If the skating is long and in the heat - the correct drinking regimen. If in the cold or rain - protection of the knees from the cold.
Joint problem. If you are actively cycling, if you have any problems with your knees, immediately consult a specialized doctor. Basically, the problems are always serious and are easily treated only in the early stages. Many athletes I know had to abandon the bike because of late diagnosed knee problems.