Short Answer
The next President would be either the Speaker of the U.S. House, following a re-election of enough seats in Congress to have a quorum to fill that post, or the Speaker Pro Temp of the U.S. Senate, following appointment of enough people to the U.S. Senate to have a quorum of enough Senators to elect someone to that post.
Realistically, given that Governors can appoint replacement U.S. Senators more quickly than representatives to the U.S. House can be elected in special elections, the position of Speaker Pro Temp of the U.S. Senate would be filled first, and that person would become the Acting President.
Long Answer
The answer from @zibadawatimmy is close to correct, but doesn't fully spell out the legal authorities that support that answer, so I do so more fully in this answer.
This follows from U.S. Constitution, Article II, Section 1, Clause 6 (as amended by U.S. Constitutional Amendment XXV in respects irrelevant to this question) which authorized Congress to enact a Presidential succession law. It states:
In the 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
Congress may be 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 remove, or a President
shall be elected.
The Presidential Succession Act of 1947, as amended is the version currently in force at Title 3 of the United States Code, Section 19 (see also this Wikipedia article on the topic which also summarizes the history of all actual permanent and temporary Presidential successions in the U.S.). The Presidential Succession Act states:
(a)(1) If, by reason of death, resignation, removal from office,
inability, or failure to qualify, there is neither a President nor
Vice President to discharge the powers and duties of the office of
President, then the Speaker of the House of Representatives shall,
upon his resignation as Speaker and as Representative in Congress, act
as President.
(2) The same rule shall apply in the case of the death, resignation,
removal from office, or inability of an individual acting as President
under this subsection. (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—
(1) if his discharge of the powers and duties of the office is founded
in whole or in part on the failure of both the President-elect and the
Vice-President-elect to qualify, then he shall act only until a
President or Vice President qualifies; and
(2) if his discharge of the powers and duties of the office is founded
in whole or in part on the inability of the President or Vice
President, then he shall act only until the removal of the disability
of one of such individuals.
(d)(1) If, by reason of death, resignation, removal from office,
inability, or failure to qualify, there is no President pro tempore to
act as President under subsection (b) of this section, then the
officer of the United States who is highest on the following list, and
who is not under disability to discharge the powers and duties of the
office of President shall act as President: Secretary of State,
Secretary of the Treasury, Secretary of Defense, Attorney General,
Secretary of the Interior, Secretary of Agriculture, Secretary of
Commerce, Secretary of Labor, Secretary of Health and Human Services,
Secretary of Housing and Urban Development, Secretary of
Transportation, Secretary of Energy, Secretary of Education, Secretary
of Veterans Affairs, Secretary of Homeland Security.
(2) An individual acting as President under this subsection shall
continue so to do until the expiration of the then current
Presidential term, but not after a qualified and prior-entitled
individual is able to act, except that the removal of the disability
of an individual higher on the list contained in paragraph (1) of this
subsection or the ability to qualify on the part of an individual
higher on such list shall not terminate his service.
(3) The taking of the oath of office by an individual specified in the
list in paragraph (1) of this subsection shall be held to constitute
his resignation from the office by virtue of the holding of which he
qualifies to act as President. (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.
The fair, and I would say, widely accepted reading of the statute, is that if, everyone in 3 U.S.C. § 19(a) and 3 U.S.C. § 19(d)(1) to fill the position, that the first person coming into being in a position designed by 3 U.S.C. § 19(a) and 3 U.S.C. § 19(d)(1) would become the Acting President.
Since no one in 3 U.S.C. § 19(d)(1) can be appointed without a Presidential nomination, the next person to come into being will always be one of the two people designated in 3 U.S.C. § 19(a), i.e. the Speaker of the U.S. House or the President Pro Temp of the U.S. Senate. These posts would be filled as soon as a quorum was present in the U.S. House or the U.S. Senate to elect such a person from their ranks as a first order of business.
Vacancies in the U.S. House are filled by Special Election. U.S. Constitution, Article I, Section 2, Clause 4 ("When vacancies happen in the Representation from any State, the Executive Authority thereof shall issue Writs of Election to fill such Vacancies.").
Vacancies in the U.S. Senate are filled by the Governor of the state with the vacancy. U.S. Constitution, Article I, Section 3, Clause 3, as amended by U.S. Constitutional Amendment XVII. The 17th Amendment states in Clause 2:
When vacancies happen in the representation of any State in the
Senate, the executive authority of such State shall issue writs of
election to fill such vacancies: Provided, That the legislature of any
State may empower the executive thereof to make temporary appointments
until the people fill the vacancies by election as the legislature may
direct.
Most U.S. States (if not all) have, in fact, empowered their Governor to make temporary appointments pending special elections to the U.S. Senate pursuant to the 17th Amendment (at the time of this Answer 45 state governors have this power, which is sufficient to appoint a quorum; Governors cannot fill U.S. Senate vacancies in ND, OK, OR, RI and WI).
The quorum in both the U.S. House and the U.S. Senate is a majority (i.e. 51 in the U.S. Senate and 218 in the U.S. House).
Each House shall be the Judge of the Elections, Returns and
Qualifications of its own Members, and a Majority of each shall
constitute a Quorum to do Business; but a smaller Number may adjourn
from day to day, and may be authorized to compel the Attendance of
absent Members[.]
U.S. Constitution, Article I, Section 5, Clause 1.
The process of Governors appointing U.S. Senators is faster than the process of conducting a special election, so a quorum of U.S. Senators would exist and appoint a President Pro Temp more quickly than the U.S. House would attain a quorum and appoint a Speaker of the House. Once that President Pro Temp was elected, that person would become acting President pursuant to 3 U.S.C. § 19(a)(2), that Senator's seat would become vacant and have to be filled again, and the U.S. Senate would elect a new President Pro Temp.
The since the Acting President was either a Speaker of the House of President Pro Temp of the Senate appointed pursuant to 3 U.S.C. § 19(a), this person would serve of the remainder of the currently Presidential term pursuant to 3 U.S.C. § 19(c).