The Umbrella singer said that newlywed Perry approached her with the track and she leapt at the chance to duet with her pal.
In an interview on US radio, she said: “She sent me a song a while ago and she wanted me to be a part of it.
“I was like, ‘Hell, yeah, of course’. She’s my girl and the song is amazing. We’ll be recording that together pretty soon.”
The 22-year-old Rude Boy singer, who appeared on Saturday Night Live at the weekend, also revealed that she was beating herself up about missing her pop star pal’s recent wedding to British comedian Russell Brand.
Rihanna, who organised Perry’s hen party, had been expected to attend the nuptials, but had to turn down the invitation due to work commitments.
She said: “I am cross that I missed that wedding. I’ll never, ever forgive myself. It was a really hard decision for me to make, but it was a crazy time.
“I was switching management. I also had to be available for the mastering of the album, as well as all the approvals of visuals, the packaging and all that stuff.”
She added: “There was no phone service in India and very little to no internet service, so it would have been a little irresponsible of me.”
Rihanna’s new album, Loud, is released this month.