A lot of things...
...can contribute to this type of pain. I've been suffering from this off & on for a couple of years now. It got really bad last September after a particularly cold mtb ride up in Tahoe. I wasn't dressed warm enough and it actually started snowing. I also didn't warm up & stretch properly. Diagnosis: slightly torn ligaments/muscles etc. Solution: 2 months of physical therapy, quad strenghtening exercises at the gym, lots of stretching every day, double check your seat height, and double check it again. Mine was too short and I think this was also a contributing factor to my knee pain. It's been 7 months now, and finally I am able to ride at full strength again. Just take it slow and give yourself enought time to recover. They do not heal quickly. The PT told me this and he was right on with that. Best of luck.
Also check out the sponsor of this message board's sponsor's site "Competitive Cyclist" make sure to click through the banner to support MTBR! They have an excellent online fitting calculator, so you can at least calculate your proper seat height.