If the pain is localized to above the knee and above the patella, this is probably a quadricep sprain/strain. Whether the muscle is actually torn is a matter of degrees - some fibers may be overstretched but for the muscle to be completely torn or ruptured is very rare.
Nevertheless, for a strain or partially torn quadricep, treatment is initially rest, ice, compression and elevation and NSAID.
After 72 hours, switch to heat and gentle stretching. Return to activity as tolerated.
For certain, see a physician for an accurate diagnosis.
Tom Plamondon PA-C, PT