Keri Russell plays Jenna, a waitress living in the American South, who is trapped in an unhappy marriage with the abusive Earl (Jeremy Sisto). She works in Joe's Pie Diner, where her job includes creating inventive pies with unusual titles inspired by her life, such as the "Bad Baby Pie" she invents after her unwanted pregnancy is confirmed. Jenna longs to run away from her dismal marriage, and is slowly accumulating money to do so. She pins her hopes for escape on a pie contest in a nearby town, which offers a $25,000 grand prize, but her husband won't let her go. Her only friends are coworkers Becky and Dawn (Cheryl Hines and Adrienne Shelly), and Joe (Andy Griffith), the curmudgeonly owner of the diner and several other local businesses, who encourages her to begin a new life elsewhere.
Jenna's life changes after she meets her new physician, Jim Pomatter (Nathan Fillion). He has moved to the small town to accommodate his wife, who is completing her residency at the local hospital, and is filling in for the woman who has been Jenna's doctor since childhood. The two are attracted to each other, and over the course of several pre-natal appointments the attraction grows. After Dr. Pomatter invites her into the office under a quickly exposed pretext, she impulsively initiates a passionate (and secret) affair.
Prompted by the gift of a baby journal, Jenna begins to keep a diary, ostensibly for her unborn child, with voiceovers giving the viewer access to her thoughts about that future child and her own plans. Between these entries, her relationship with Dr. Pomatter, and the thoughts she reveals as she describes the various pies she creates, the audience gets to know her evolving hopes and dreams, concerns and fears, and slowly growing attachment to the baby she at first didn't want.
After giving birth, Jenna bonds immediately with the baby girl she names Lulu. Earl, clearly disappointed it's a girl and witnessing that bonding, reminds Jenna of a promise he had forced her to make earlier not to love the baby more than she does him. That comment, the proverbial straw that broke the camel's back, wipes away any concerns she has about her lack of money and her fear of her husband. With determined frankness she tells him bluntly she hasn't loved him in years, will no longer put up with his possessiveness and abuse, and wants a divorce. Later, while Becky and Dawn are helping her prepare to leave the hospital and letting her know that Joe had lapsed and died, Jenna remembers an envelope Joe had brought to her before the birth, when she finds out he had been admitted as a patient in the same hospital. In the envelope she finds a handmade card with a sketch of her, a check for $270,450, and a message of friendship that urges her to start her life anew. While leaving the hospital, Dr. Pomatter wants to have a word with her in private regarding their affair and what is to happen now. She promptly breaks it off, handing him a chocolate Moon Pie and asks her friends to wheel her out. On the way out they ask her what that was all about, to which she coolly replies that she was having an affair with him and just ended it.
An epilogue depicts Jenna winning the pie contest, and becoming the new owner of the diner where she worked, now called Lulu's Pies, serving brightly colored pies to her customers and friends. The final shot shows her walking home hand-in-hand with the now toddler-aged Lulu (played by Shelly's actual daughter, Sophie).