What Happens when the Pope Dies?
The Rev. Thomas J. Reese, S.J., editor in chief of America, a Catholic Weekly, has written an excellent explanation of what happens next if the pope goes into a coma or dies. See complete report.
Here's his partial explanation of who would be in charge between the pope's death and the election of the new pope.
"All the cardinals and archbishops in charge of departments in the Roman curia, including the secretary of state (Cardinal Angelo Sodano), lose their jobs when the pope dies. The ordinary faculties of these offices, which are run by their secretaries during the interregnum, do not cease on the death of the pope, but serious and controversial matters are to await the election of a new pope. The offices are run by their secretaries who remain in position...Any decision made is provisional until confirmed by new pope."

