The Presidential Succession Act establishes who shall exercise the powers and duties of the office of President of the United States in the event that neither a President nor Vice President is able to "discharge the powers and duties of the office." The current Act was adopted in 1947 and is codified at 3 U.S.C. § 19.
Constitutional authority for Congress to enact such a law is twofold: Article II, Section 1, Clause 6 and Section 3 of the Twentieth Amendment.
3 U.S.C. § 19. Vacancy in offices of both President and Vice President; officers eligible to act
(a)
(b) If, at the time when under subsection (a) of this section a Speaker is to begin the discharge of the powers and duties of the office of President, there is no Speaker, or the Speaker fails to qualify as Acting President, then the President pro tempore of the Senate shall, upon his resignation as President pro tempore and as Senator, act as President.
(c) An individual acting as President under subsection (a) or subsection (b) of this section shall continue to act until the expiration of the then current Presidential term, except that –
(d)
(e) Subsections (a), (b), and (d) of this section shall apply only to such officers as are eligible to the office of President under the Constitution. Subsection (d) of this section shall apply only to officers appointed, by and with the advice and consent of the Senate, prior to the time of the death, resignation, removal from office, inability, or failure to qualify, of the President pro tempore, and only to officers not under impeachment by the House of Representatives at the time the powers and duties of the office of President devolve upon them.
(f) During the period that any individual acts as President under this section, his compensation shall be at the rate then provided by law in the case of the President.