I've sometimes have leg pain from driving when my foot hits the gas petal. What's wrong?

Muscle problem. If your pain is in your leg then it is likely muscular in nature. The muscles that move your foot up and down are actually attached in your lower leg. So pain when you point your foot down could be from an injured or sore muscle. There are other structures tht could cause the pain so you probably need to go see someone for a physical exam.
Position. It is probably the position of your foot pulling on your leg muscles. Also the way you sit may be putting pressure on your sciatic nerve.
What part? What part of the leg hurts? If it is by the heel you can have achilles tendonitis, if it is in the calf you could have a clot (this is a serious condition.) if it is behind the knee you could have a baker's cyst. It could also be a cramp in the calf or a strain. Try squeezing your calf to see if you have pain as this would be pain you would have to worry about as this could tip you off of a clot.