Generally, this is due to pockets of air in the cartridge. USUALLY the only air is when you put on a new cartridge, but it's not unusual to have bubbles down in the cartridge. The "pump" on the gun works very poorly (if at all) on air; it needs the incompressible grease in the pump cylinder to pull a new shot of grease from the cartridge.
There's usually an air vent screw on the top of the gun. When it stops pumping, loosen the screw a turn or so, and try pumping some more. Sometimes it helps to rap the whole gun on something solid to get the air bubble to pass. When it starts pumping again, retighten the screw and you're good to go (until the next bubble).
- Jay