At seventeen, Veronica "Ronnie" Miller remains as rebellious as she was the day her parents divorced and her father moved to Georgia three years prior. Once a classical piano child prodigy under the tutelage of her father, Steve Miller (Greg Kinnear), Ronnie now ignores the instrument and has not spoken with her father since he left. While Juilliard School has been interested in her since she was young, Ronnie refuses to attend.
Now, Steve has the chance to reconnect with his estranged daughter when her mother, Kim Miller sends the rebellious teen and her younger brother, Jonah to spend the summer with him. Steve, a former Juilliard School professor and concert pianist, lives a quiet life in Wrightsville Beach, the small beach town in North Carolina where he grew up, working on a stained glass window for the local church to replace the one the church lost in a fire. According to the locals, it was Steve who had set fire to the church one night.
After arrival, Ronnie becomes miserable, defiant, and defensive toward all those around her. Including handsome, popular Will Blakelee whose introduction involved crashing into her during a volleyball match, and accidentally spilling Ronnie's strawberry shake on her. She shrugs him off and meets Blaze, an outcast who lives with her boyfriend Marcus. While at a beach campfire, Marcus hits on Ronnie and Blaze mistakes this for Ronnie flirting with him. Angered by this, Blaze sets Ronnie up by putting a bracelet in Ronnie's bag. Just as Ronnie walks out she is promptly arrested, which reminded her of an incident that occurred back home. Later on, Ronnie discovers a Loggerhead Sea Turtle nest at the beach by her house and while protecting it, she meets Will again on his volunteer work for the aquarium. After a night of staying up to defend the turtles with Will, she discovers he is deeper than she believed, and begins to have feelings for him.
As Ronnie falls in love with Will, she also manages to form a better and stronger bond with her father. As their relationship deepens, Will invites her to his sister's wedding. Later that day, the turtle eggs hatch and her father collapses with a coughing seizure that evening. Ronnie immediately has Steve rushed to a hospital and realizes that he had been diagnosed with cancer long before her summer visit (in a prior scene, he reveals having been on a medication and possibly setting fire to the church) and why her parents' marriage has fallen apart. She decides to start spending more time with her father since he is unlikely to survive any longer. Around the same time, Ronnie and Will get into a confrontation because Will confessed that Scott had actually set fire to the church, but he had never confessed. With Will now leaving for college, there is no time to patch things up.
Steve has been working on a piece of music for quite a while. Fall comes and Jonah returns to New York for the school year but Ronnie stays behind to take care of her father. Leading a slow life she tries to fill in the three years of ignoring her father into a couple months. She continues working on his piece of music (titled "For Ronnie"), finishing what her father could not (because of his hands). When she finally plays the last chord, she looks up to see that Steve had died while listening to her play and is heartbroken.
At his funeral she stands to make a speech but declares that none of the speeches she wrote would ever be able to show how wonderful her father really was. Instead, she decides to share with them the song she helped finish. Before she sits down to play, sunlight shines through the stained glass window. Ronnie smiles as she remembers overhearing her father say that every time a light shines through that window or any window, it's him and says "Hi, Daddy."
At the funeral, while Ronnie is talking to the attendants, she runs into Will. He says that he liked the song she played and that he knows her dad did too and Ronnie thanks him for coming to the funeral. At the end of the movie, Ronnie is packing up her dad's stuff when she sees Will standing outside. She goes outside to see him and Will apologizes to her for everything that had happened and Ronnie forgives him. Will surprises Ronnie by revealing that he will be transferring to Columbia in order to be with her and they share a kiss. The last scene shows her packing up her car and driving away.