The large muscle on the back of the upper leg is generally referred to as the hamstring. Usually, a pulled muscle responds best to ice. We advise you to apply an ice pack that has a thin cloth covering so you do not damage the skin with too much cold. Apply it to the sore muscle area 20 minutes on, followed by 20 minutes off, while awake, for at least 2 days.
Also, if you have no allergies to aspirin or related medications called NSAIDS (non steroidal anti-inflammatory medications) such as ibuprofen (Advil, Motrin),naproxen (Aleve, Anaprox, Naprosyn), then you will probably benefit from taking one of these according to their package instructions for 5 to 7 days. Take them with food to help avoid stomach irritation.