I regularly get a snippet of a song in Japanese that includes the line ~mawaru, mawaru recordo~ (lit. "spinning, spinning record") stuck in my head whenever I'm cruising on my Campy-equipped bike, and that puts a smile on my face, even though I know the song is actually referring to a musical recording and not a beautiful Super Record crankset.
More seriously, when I get out of the saddle, or if I'm suffering on a hard climb, my mantra is to start counting in my head 'one Mississippi, two Mississippi...', helps me keep my breathing rhythmic and evaluate my effort more objectively. If the suffering continues for an extended period, I will switch to counting in a different language, or I will start doing multiplication tables or trying to see how far I can take the Fibonacci sequence without paper to help.