Ryan’s sister died when she fell off the swings as a child. Ryan’s parent’s blamed him and punished him by making him dress up as his sister and pretend to be her. He is actually the one killing them at the beginning of the movie, dressed as a girl.
Since his parents had told everyone that he was sent away to live with his aunt, the town thought his sister killed the parents and ran off into the woods. After their deaths, Ryan (Max Thieriot) started abducting women, dressing them as his sister, and keeping them drugged and locked in the basement.
When Elissa (Jennifer Lawrence) stumbles upon his secret, he tries to make her into his “sister.” She gets away by shooting him, although he doesn’t die.
At the end of the movie, Ryan is locked away in a psych ward, and Elissa and her mom (Elisabeth Shue) move away.