A pacemaker (or artificial pacemaker, so as not to be confused with the heart's natural pacemaker) is a medical device which uses electrical impulses, delivered by electrodes contracting the heart muscles, to regulate the beating of the heart.

The primary purpose of a pacemaker is to maintain an adequate heart rate, either because the heart's natural pacemaker is not fast enough, or because there is a block in the heart's electrical conduction system. Modern pacemakers are externally programmable and allow a cardiologist to select the optimum pacing modes for individual patients. Some combine a pacemaker and defibrillator in a single implantable device. Others have multiple electrodes stimulating differing positions within the heart to improve synchronisation of the lower chambers (ventricles) of the heart.

More Info: en.wikipedia.org