 Gary Shaller (Freeman), who gained commercial success in previous years as the keyboard player in the band "On the One", is in a failing marriage with Dora (Gwyneth Paltrow), and working for his former bandmate Paul (Simon Pegg), writing and recording commercial jingles.Gary eventually discovers that he is having lucid dreams about a glamorous woman named Anna (Penélope Cruz), with whom he is deeply infatuated.He aims to learn more about lucid dreaming by buying books and even attending classes taught by an eccentric lucid-dreaming enthusiast, Mel (Danny DeVito).