It is very important to not use your feet when the pain strikes. Don't put any pressures to your leg muscles for example by standing or walking, as they can worsens the pain because of excessive muscle strain. In severe cases even sitting can cause thigh pain, then it is necessary to lie down.
Compress your thigh with a bag of ice in the location where the pain is felt. Put it on for twenty minutes and then put it again in the next 3 hours of the pain is still felt.
Wrap the thigh with flexible bandages, for example the ACE wrap, for adding more pressure on the painful location on your thigh. It could bring down pain, which in turn could cut down the thigh pain. You may buy such bandages at a retail store or pharmacy.
Elevate the whole leg with pillows. Keep the thigh lifted at about the same level with the chest. It is better if you lay on your side.
If possible take a mild painkiller, such as ibuprofen or Tylenol. Do the above steps again until the pain subsides, and if it lasts for more than three days then you should see a doctor.