Recently I have almost fallen because of a sudden weakness in my thigh area while going down or coming up stairs? What could be the cause?

Various. Presumably you have some dysfunction of the muscles in the leg which most likely originate in the spinal column. You might have a disc displacement, compression fracture or a vacular or tumorous lesion interfering with the nerve supply. You should see your neurologist to sort this out fairly quickly.
Knee Pain? Pain from the patello-femoral joint, even if unrecognized at the consious level may inhibit quadricep strength at a spinal cord reflex level. The patello-femoral joint commonly can be painful with stair climbing and descending. An orthopedist may be helpful in diagnosis, especially if you are having no other neurologic symptoms like numbness or tingling.