Rafferty was a democrat elected to the United States Senate. She entered the 2006 Democratic Primary as an issues candidate with no serious interest to win the nomination. To force the other candidates to talk about reforming health care, Toby Ziegler gave her President Bartlet's old plan for it that he was talked out of by his campaign staff. She would use this in her speeches, causing people to believe that the President was planning on endorsing her while he claimed to remain neutral until the general election. The two were eventually uncovered when Donna Moss, working for the Russell for President campaign received the senator's future speeches and gave them to Josh Lyman.
After being uncovered Toby advised her to pull out before the South Carolina primaries so that she would not damage the Party's chances in the general election. He argued that she could have a shot at a Vice-Presidential spot on the ticket. While she was against this initially, he convinced her to drop out. ("Drought Conditions")
Behind the scenes
This is the second time that the show used a male-sounding name for a woman to throw off gender expectations. With Joey Lucas it was just a little joke. In this case, the episode "Drought Conditions" features Toby Ziegler chatting with a woman in a bar, seemingly as if she's a love interest, interspersed with flashbacks about a conflict with Josh Lyman over an unseen Senator Ricky Rafferty. The end of the episode reveals that the woman Toby's been talking to at the bar is Ricky Rafferty.
The role of Ricky Rafferty was played by Mel Harris.IMDb