The Twenty-fifth Amendment (Amendment XXV) to the United States Constitution deals with succession to the Presidency and establishes procedures both for filling a vacancy in the office of the Vice President, as well as responding to Presidential disabilities. It supersedes the ambiguous wording of Article II, Section 1, Clause 6 of the Constitution, which does not expressly state whether the Vice President becomes the President or Acting President if the President dies, resigns, is removed from office or is otherwise unable to discharge the powers of the presidency. The Twenty-fifth Amendment was adopted on February 10, 1967.

Section 1. In case of the removal of the President from office or of his death or resignation, the Vice President shall become President.
Section 2. Whenever there is a vacancy in the office of the Vice President, the President shall nominate a Vice President who shall take office upon confirmation by a majority vote of both Houses of Congress.
Section 3. Whenever the President transmits to the President pro tempore of the Senate and the Speaker of the House of Representatives his written declaration that he is unable to discharge the powers and duties of his office, and until he transmits to them a written declaration to the contrary, such powers and duties shall be discharged by the Vice President as Acting President.
Section 4. Whenever the Vice President and a majority of either the principal officers of the executive departments or of such other body as Congress may by law provide, transmit to the President pro tempore of the Senate and the Speaker of the House of Representatives their written declaration that the President is unable to discharge the powers and duties of his office, the Vice President shall immediately assume the powers and duties of the office as Acting President.
Thereafter, when the President transmits to the President pro tempore of the Senate and the Speaker of the House of Representatives his written declaration that no inability exists, he shall resume the powers and duties of his office unless the Vice President and a majority of either the principal officers of the executive department or of such other body as Congress may by law provide, transmit within four days to the President pro tempore of the Senate and the Speaker of the House of Representatives their written declaration that the President is unable to discharge the powers and duties of his office. Thereupon Congress shall decide the issue, assembling within forty-eight hours for that purpose if not in session. If the Congress, within twenty-one days after receipt of the latter written declaration, or, if Congress is not in session, within twenty-one days after Congress is required to assemble, determines by two-thirds vote of both Houses that the President is unable to discharge the powers and duties of his office, the Vice President shall continue to discharge the same as Acting President; otherwise, the President shall resume the powers and duties of his office.

The Twenty-fifth Amendment in the National Archives

Article II, Section 1, Clause 6 of the Constitution states:
In Case of the Removal of the President from Office, or of his Death, Resignation, or Inability to discharge the Powers and Duties of the said Office, the Same shall devolve on the Vice President, and the Congress may by Law provide for the Case of Removal, Death, Resignation or Inability, both of the President and Vice President, declaring what Officer shall then act as President, and such Officer shall act accordingly, until the Disability be removed, or a President shall be elected.
That clause was unclear regarding Presidential succession and inability; it did not state who had the power to declare a President incapacitated. Also, it did not provide a mechanism for filling a Vice Presidential vacancy prior to the next Presidential election. The vagueness of this clause caused difficulties many times before the Twenty-fifth Amendment’s adoption:
In 1841, President William Henry Harrison became the first U.S. President to die in office. Representative John Williams had previously suggested that the Vice President should become Acting President upon the death of the President. John Tyler asserted that he had succeeded to the presidency, as opposed to only obtaining its powers and duties. He also declined to acknowledge documents referring to him as “Acting President”. Although he felt his vice presidential oath negated the need for the presidential oath, Tyler was persuaded that being formally sworn-in would clear up any doubts about his right to the office. Having done so, he then moved into the White House and assumed full presidential powers. Tyler’s claim was not formally challenged, and both houses of Congress adopted a resolution confirming that Tyler was the tenth President of the United States, without any qualifiers. The precedent of full succession was thus established. This became known as the “Tyler Precedent”.
There had been occasions when a President was incapacitated. For example, following Woodrow Wilson’s stroke no one officially assumed the Presidential powers and duties, in part because the First Lady, Edith Wilson, together with the White House Physician, Cary T. Grayson, covered up President Wilson’s condition.
The office of Vice President had been vacant sixteen times due to the death or resignation of the Vice President or his succession to the presidency. For example, there was no Vice President for nearly four years after the death of Franklin D. Roosevelt.
All of these incidents made it evident that clearer guidelines were needed. There were two proposals for providing those guidelines.

Keating–Kefauver proposal

In 1963, Senator Kenneth Keating of New York proposed a Constitutional amendment which would have enabled Congress to enact legislation providing for how to determine when a President is disabled, rather than, as the Twenty-fifth Amendment does, having the Constitution so provide. This proposal was based upon a recommendation of the American Bar Association in 1960.
The text of the proposal read:
In case of the removal of the President from office or of his death or resignation, the said office shall devolve on the Vice President. In case of the inability of the President to discharge the powers and duties of the said office, the said powers and duties shall devolve on the Vice President, until the inability be removed. The Congress may by law provide for the case of removal, death, resignation or inability, both of the President and Vice President, declaring what officer shall then be President, or, in case of inability, act as President, and such officer shall be or act as President accordingly, until a President shall be elected or, in case of inability, until the inability shall be earlier removed. The commencement and termination of any inability shall be determined by such method as Congress shall by law provide.
Senators raised concerns that the Congress could either abuse such authority or neglect to enact any such legislation after the adoption of this proposal. Tennessee Senator Estes Kefauver (the Chairman of the Senate Judiciary Committee’s Subcommittee on Constitutional Amendments), a long-time advocate for addressing the disability question, spearheaded the effort until he died of a heart attack on August 10, 1963.

Kennedy assassination

With President John F. Kennedy’s assassination, the need for a clear way to determine presidential succession, especially with the new reality of the Cold War and its frightening technologies, forced Congress into action. The new President, Lyndon B. Johnson, had once suffered a heart attack, and the next two people in line for the presidency were Speaker of the House John McCormack, who was 71 years old, and Senate President pro tempore Carl Hayden, who was 86 years old. Senator Birch Bayh succeeded Kefauver as Chairman of the Subcommittee on Constitutional Amendments and set about advocating for a detailed amendment dealing with presidential succession.

Bayh–Celler proposal

On January 6, 1965, Senator Birch Bayh proposed in the Senate and Representative Emanuel Celler (Chairman of the House Judiciary Committee) proposed in the House of Representatives what became the Twenty-fifth Amendment. Their proposal specified the process by which a President could be declared disabled, thereby making the Vice President an Acting President, and how the President could regain the powers of his office. Also, their proposal provided a way to fill a vacancy in the office of Vice President before the next presidential election. This was as opposed to the Keating–Kefauver proposal, which did not provide for filling a vacancy in the office of Vice President prior to the next presidential election or itself provide a process for determining presidential disability. In 1964, the American Bar Association endorsed the type of proposal which Bayh and Celler advocated.
On February 19, the Senate passed the amendment, but the House passed a different version of the amendment on April 13. On July 6, after a conference committee ironed out differences between the versions, the final version of the amendment was passed by both Houses of the Congress and presented to the states for ratification.

 

(the above from wikipedia)