The gas pedal (more properly called the accelerator) can sometimes begin to stick on a car, causing the engine to run fast or the pedal to stay down even after you've moved your foot from it. This is a dangerous situation, but is often easily fixed.
First, a note of warning: if your pedal is sticking, you should immediately pull over to a safe place. If the car won't slow down, shift it into neutral to disengage the engine, turn on your hazard lights, and attempt to get off the road. Do NOT turn the engine off until you're safely stopped as components like power steering and your steering wheel lock will make it hard to maneuver your car if you do so. Try "unsticking" the pedal by pumping it a time or two or by hooking your toes underneath and pulling outwards. If stopped, reach down and try to do this with your hand.
Common Causes of Sticking Pedals
As with the Toyota recall in 2011, the problem may be as simple as your floor mat allowing the pedal to "catch" and get stuck or a little more complex.
If it's not the floormat than it's most likely in the throttle linkage. This is the connection from the pedal to the throttle on the engine, which controls the fuel-air mixture and causes the engine to speed up or slow down.
Think of your pedal as a lever onto which a wire has been attached at one end. When you press the other end with your foot, the wire is pulled. At the other end of that wire is a valve that opens and closes as the wire is pulled and released, allowing more or less fuel in depending on the position of the pedal to which the wire is attached. In an over-simplified way, this is basically how your accelerator pedal and linkage work.
The problem you're experiencing is going to be in the pedal, the linking cable, or the throttle itself. On most vehicles, those are literally the only three parts that make up the accelerator and throttle body.
Fixing the Problem
The easiest place to start is the pedal itself. Spray lubricant onto the spring and fulcrum (leverage point or hinge) for the pedal. Make sure they are not squeaking and are easily moved in and out. If that fixes your problem, then great. In some cases it will and it costs you only a few minutes' time to do.
Next, you'll want to look at the throttle body. To do this, you'll need to remove the breather (the end of the air intake that connects to the throttle body on the engine). If your engine has a carburetor, then this will likely mean removing the air filter canister on top of the engine. If your engine is fuel injected (as most are now), then it will likely just be a simple pipe clamp that you unscrew and pull the hose off.
Whether fuel injected or carburated, the throttle body is basically the same in terms of how it works for our purposes here. There will be a "paddle" that pivots inside a round hole to open or close the intake for air and a small lever attached which controls this. That same lever likely controls a small valve underneath that designates how much fuel is to be sent into the engine - on some fuel injected vehicles, this may be an electronic box that is manipulated by the throttle.
The cable should easily disconnect from the throttle control, often with just a small wrench or screwdriver turning a nut or screw. Refer to your owner's manual. Most are removable without causing a change in adjustment, which is ideal.
Once the control cable is removed, manually move the throttle body with your fingers. If you feel resistance or "stickiness," then it needs cleaning and lubrication. You'll need a toothbrush, some brake cleaner, and a good oily lubricant like a small machine oil can (avoid WD-40 as it's not truly a lubricant).
Use the brake cleaner to thoroughly hose down the throttle body and the toothbrush to scrub in where the hinges and joints are. Use a lint-free rag to clean off the spring(s) and whatever other components you can as well. Once thoroughly cleaned, allow it to dry (with brake cleaner, this should only take a few minutes).
Now use the machine oil to gently lubricate the spring, hinges, and any other moving parts you can see. Now manipulate the throttle again with your fingers and see if it moves more freely. If so, you've probably fixed the problem. Put everything back together and you're done.
If that didn't work, then you'll need to go back to the pedal again. This time, disconnect the cable where it attaches to the pedal and then try it with your hand to see if you hear squeaking or can feel where the stickiness begins. You may need to remove the pedal and thoroughly clean the moving parts (hinge) and spring. Check for debris under or on top of the pedal that may be causing the stick as well.
If none of these things fix the problem, then it may lie in the engine itself and require a more thorough mechanical knowledge to repair.