The Joint Pain can be prevented if there are regular movements as the immobility increase the risk of damage to the cartilage...
Osteoarthritis is a common in old age due to wear and tear of the knee joints and muscles.  It is very common in obese persons even in middle ages they get severe attacks of this pain, they should take immediate steps to reduce their body weight to reduce the pain.  Other causes like autoimmune or metabolic inflammatory condition and post-traumatic osteoarthritis are the reasons for knee pain in the middle ages. However, for teen ages, sporting or trauma injury might be the reason. 
The pain may be sudden and progressive depending on the body condition, consult the doctor if they persist for a longer period of time.  The knee may cause problems when climbing stairs up or down and may need support to hold as a result of excess pain. 
The pain is due to the degeneration of knee cartilage, which cannot regenerate or heal unlike the bone ligaments and bones structures.  Cartilage is a connective tissue which is flexible and it degeneration or damage cause pain, inflammation or stiffness.  Metabolism is slowed down as the age advances and tissues start deteriorating, causing pain.  Osteoporosis due to calcium deficiency may be also another reason for knee pain. 
Proper exercises with the help of Physiotherapist may also help if the pain is mild.  Doctors would suggest X-ray and MRI diagnose the knee problems. The Joint Pain can be prevented if there are regular movements as the immobility increase the risk of damage to the cartilage. Applying Eucalyptus Oil would help to relieve pain.
Injections into the knee such as hyaluronic acid may be administered. Steroids are not a long-term treatment option as they have severe destructive side effects. For severe knee pain, surgical treatments such as arthroplasty for young individuals and total knee replacement for older patients can be effective.