Pull the code....if it's P0300 then you have spark issues.
If it only does it when you put your foot in the gas it's most likely the plugs and wires. If it does it all the time, then you need to check the plugs, wires, and the coils. A good way to figure this out is to find out which cylinder is not firing, and then swap the coils to see if the condition follows the coil pack.