The Prophet (peace and blessings be upon him) said: "When the imam says Sami'allahu liman hamidah, then say Allahumma Rabbana wa lakal-hamd."