While Hamm puckered up with SNL regular Jason Sudeikis, the Umbrella singer donned a pinstripe suit and wielded a gun to perform a song with Andy Samberg.
The side-splitting scenes from the US entertainment show were screened in the United States on Saturday night – Halloween weekend.
Hamm, 39, was the guest host for SNL and took part in a string of skits.
As well as dressing as a seventies cop and kissing Sudeikis, he played a reality TV star, a wannabe actor and a lounge singer.
Rihanna also performed two songs during the show and seemed to struggle to contain her chest in a red bikini top.
The 22-year-old singer was seen pulling at her top and pushing up her breasts during one of her performances.