Hearn said a deal has been clinched that will see the rematch take place in November or December.
Joshua lost his WBA, IBF and WBO heavyweight belts after a shock seventh-round TKO at the hands of challenger Ruiz at Madison Square Garden in New York on Saturday.
The new fight deal was struck in accordance with what Joshua and trainer Rob McCracken wanted, Hearn indicated.
The 29-year-old British boxer said immediately after his division-shaking defeat that he wanted to tackle Ruiz again, and Hearn confirmed a clause has been triggered that will mean he gets his wish.
Hearn wrote on Twitter: "After meetings with AJ, Rob Mc and the management team in NY, we have today triggered the contracted rematch clause with Andy Ruiz Jnr. The fight will take place in Nov/Dec at a venue to be confirmed shortly."
California-born Ruiz indicated before Hearn's announcement that he would relish taking on Joshua in Mexico, where Ruiz's parents are from.