Maya (Rani Mukerji) is an orphan who is to marry her closest childhood friend Rishi Talwar (Abhishek Bachchan). The two have been raised by Rishi’s fun-loving father Samarjeet a.k.a. Sam (Amitabh Bachchan). Dev Saran (Shah Rukh Khan) is a successful soccer player in the United States. He lives in New York with his wife Rhea (Preity Zinta), a fashion magazine editor, his young son Arjun (Ahsaas Channa) and his mother Kamaljeet a.k.a. Kamal (Kirron Kher). Dev encounters Maya moments before she is to marry Rishi, and the two have a deep conversation about love, life, and happiness. Although Dev and Maya are strangers, they connect instantly. When Dev bids Maya goodbye, she tells him they should never say goodbye because it kills the possibility of meeting again. Moments after they part, Dev is hit by a car and permanently injures his leg; as a result, he is no longer able to play soccer.
Four years later, Dev is now extremely bitter because of his inability to play soccer and second because of Rhea’s successful career which makes him feel inferior to her. Maya is in a similar situation. She has found that she is infertile and does not feel any love towards Rishi because she believes he is selfish. The two couples meet and become friends. When Dev and Maya witness Sam and Kamal embracing at a flower shop, they confront them about it. Sam and Kamal explain that both having lost their spouses, they understand each other better than the others as both of them are in similar situations and have decided to help one another through their loneliness by means of friendship. Dev and Maya notice each other’s marriages failing miserably, and taking into account what Sam and Kamal said, they decide that they need to help each other save their marriages. They meet every day for coffee and discuss their situations and advise each other in understanding their respective spouses better. Eventually, Dev and Maya decide to take a break from the stress of their respective relationships and spend some quality time together. In doing so, they find themselves drawn to one another.
Dev and Maya arrange a dinner for their respective spouses on the occasion of their wedding anniversaries so as to salvage their respective marriages to some extent. After returning home from the dinner, both couples have an argument. Rhea accuses Dev of being jealous of her professional success and also makes Dev realize his failure in being a good father to their son. Rishi expresses frustration at the lack of affection that Maya has shown towards him and he resents Maya’s inability to have children. Upset and misty-eyed, Maya arrives at the train station and finds Dev, who after a confrontation finally confesses that he has fallen in love with Maya, and so has she.
Sam and Kamal, after noticing the failing marriages of their respective children, set up Rhea and Rishi into talking to each other about their marriages. Rhea and Rishi realize they need to stop arguing with their spouses and reach out to them. For a while, both marriages seem to be fine; however, Dev and Maya begin an affair, as they are happier with each other than with their respective spouses. The two couples attend a ballet show, where Dev and Maya try making each other jealous by showing affection to their partners. The next day, they realize that they have been playing with their spouses’ feelings but nevertheless give in to their love and cross the forbidden limit.
Sam invites the Sarans to dinner to celebrate Kamal’s birthday. Here, after a conversation on love, marriage and fidelity, Dev ‘jokingly’ admits he loves Maya; Sam is the only one who realizes that Dev was being serious. The next day, Dev and Maya are caught in an embrace outside the train station by Sam and Kamal. Sam has a heart attack; on his deathbed, he advises Maya to leave Rishi, as neither of them is happy in the relationship and never will be. He also advises her that by being together in a loveless marriage, she was depriving Rishi and herself of true love in life. After Sam’s death, Dev and Maya decide they must end their relationship and go back to their respective spouses, but first they must tell them the truth first about their extramarital affair; as lying to their spouses would never give them peace and happiness. Shocked and heart-broken, Rhea and Rishi decide they have had enough and divorce their spouses. Dev and Maya lie to each other and say that they have managed to sort things out with their spouses, believing they’ll never meet again.
Three years have passed since their last encounter with each other. Dev and Maya now live alone miserably and have not seen each other. Rishi visits Maya and says that he has fallen in love again and is remarrying, and wants Maya to be his best man, to which she agrees. Rhea, having also been invited, arrives at Rishi’s wedding with her boss Jay (Arjun Rampal in a cameo), whom she is now dating. Rhea learns that Rishi and Maya are divorced – Rishi learns the same about Dev and Rhea. Rhea, after confronting Maya tells her that she had left Dev as soon as she came to know of his affair with her and that she had forgiven Maya. Maya is encouraged by Rishi and Rhea to stop Dev, who is leaving for Toronto by train, as they have both moved on and believe Maya should also find her true love and happiness. At the station, Dev sees Maya but tries to avoid her, believing she is still with Rishi. However, Maya finds him just as the train leaves. Maya, disappointed and heart-broken, leaves the train station. Dev, having seen Maya’s teary eyes, pulls the emergency stop and arrives back at the station. He makes it back before Maya leaves the train station. He calls out to Maya and both of them are glad to see each other after three years. He learns that Maya has also been divorced and was living alone in these three years. They finally find true happiness with their love and decide to start a new life together. At the end, Dev narrates that love should be the only foundation of marriage but it shouldn’t be at the expense of hurting others.