The film uses an omniscient narrator to provide information on the characters and their personal life, historical Mexican events, and the settings depicted in the film. These "footnotes" also reveal the economic and political issues in Mexico, particularly the impoverished lifestyle of people living in rural areas across the country.
The story itself begins at the threshold of the protagonists' adulthood. Julio (Gael García Bernal) comes from a leftist middle-class family and Tenoch's (Diego Luna) father is a high-ranking political official. The film opens with a scene of each boy having sex with his girlfriend one last time before the girls leave on a trip to Italy. Without their girlfriends around, the boys take the opportunity to live as bachelors. At a wedding, they meet Luisa (Maribel Verdú), an older woman and the wife of Tenoch’s cousin Jano. The boys attempt to impress her with talk of an invented, secluded beach called Boca del Cielo ("Heaven's Mouth"), but she initially declines their invitation to accompany them there. Later, Luisa visits the doctor for some test results (the details of which the audience does not learn). After her appointment, she receives a phone call from Jano in which he tearfully confesses that he's been cheating on her. The next day, Luisa calls Tenoch and asks if their offer to accompany them to the beach is still open.
Though Julio and Tenoch have no idea where to find the promised beach, the three set off for it, driving through rural Mexico. They talk about their relationships and sexual experiences to pass the time: the boys boast about the number of women they have slept with while Luisa speaks of Jano and wistfully recalls her first love who died in a motorcycle accident. During an overnight stop, Luisa leaves a tearful message on Jano’s answering machine explaining that she has left him. Tenoch enters her motel room in search of shampoo, but finds her crying. Luisa seduces him, and he awkwardly but enthusiastically has sex with her. Julio sees this from the open doorway and is obviously upset, but walks away and sits down outside by the pool. Tenoch comes down to the pool and it is here that Julio informs Tenoch that he's had sex with Tenoch's girlfriend. The next day, Luisa notices the boys are quiet with each other, so she has sex with Julio to equalize their perceived status. Tenoch then reveals he had sex with Julio's girlfriend. The boys begin to fight, until Luisa threatens to leave them.
By chance they turn onto an isolated beach whilst driving along the coastal road that evening. They begin to relax and enjoy the ocean along with the company of a local family. In the nearby village, Luisa makes a final phone call to Jano, bidding him an affectionate but final farewell. That evening, the three drink excessively and joke recklessly about their sexual transgressions, revealing that each boy has frequently had sex with the other's girlfriend. Julio says "Y tu mamá también," (meaning that he's had sex with Tenoch's mother)—an opportunistic joke Julio tells in light of their shocking confessions. The three dance together sensually, then retire to their room. They begin to undress and grope drunkenly. As Luisa kneels and stimulates them both, the boys embrace and kiss each other passionately.
The next morning, the boys wake up together, naked. Luisa has risen early. When Tenoch and Julio find themselves in the same bed, they immediately turn away and are eager to return home. The narrator explains that their journey back was quiet and uneventful and that Luisa stayed behind to explore the nearby coves. The narrator further discloses that Tenoch and Julio began relationships with other girls and stopped spending time with one another.
The final scene follows a chance encounter in Mexico City a year later — in 2000 when the Institutional Revolutionary Party lost a federal election for the first time in 71 years. Tenoch and Julio are having a cup of coffee, awkwardly catching up on each other's lives and news of their friends. Tenoch informs Julio that Luisa died of cancer a month after their trip and that she was aware of her illness during the time they spent together. Tenoch excuses himself because his girlfriend is waiting for him. Julio is left in the coffee shop. The narrator reveals that they will never see each other again.