The setting of the film is an isolated farm in Doylestown, Pennsylvania. Former Episcopal priest Graham Hess (Mel Gibson) lives there with his asthmatic preteen son Morgan (Rory Culkin) and younger daughter Bo (Abigail Breslin). Graham's younger brother Merrill (Joaquin Phoenix), a failed minor-league baseball player, has been living on the farm to help out since Graham's wife Colleen died in a traffic accident six months earlier, shown in a series of flashbacks. Graham has since lost his religious faith and abandoned the church.
Large crop circles appear in the Hess's cornfield that are initially attributed to vandals. Soon after, other crop circles, eventually determined to be navigational guides, appear globally, and lights from invisible objects hover over Mexico and other cities later on. One night, Graham and Merrill chase a tall dark figure that disappears into the field. Graham later glimpses another one among the corn stalks, and strange clicking noises are heard over Bo's old baby monitor. In Brazil, an alien is filmed during a child's birthday party.
Ray Reddy (M. Night Shyamalan), the man responsible for Colleen's fatal accident, calls the Hess house but hangs up. Graham goes to investigate, finding Reddy sitting inside his car. Reddy expresses remorse for Colleen's death and Graham losing his faith. As he is about to drive to a lake, believing the aliens avoid water, Reddy warns Graham that a creature is locked inside his pantry. Graham investigates but leaves quickly when the trapped alien tries to attack him.
As a worldwide alien invasion begins, the Hesses barricade themselves inside their house. As several aliens break into the house, the family retreats to the basement. Morgan has an asthma attack but survives the night, despite being without his medication. The family emerge the next morning after radio reports say the aliens have abruptly abandoned Earth, stranding some aliens. The alien which had been trapped inside Ray Reddy's pantry enters the house and takes Morgan hostage. Recalling Colleen's dying words, Graham tells Merrill to, "swing away", using his baseball bat. The alien sprays Morgan with a toxic gas from its wrist. Graham recovers his stricken son as Merrill bashes the creature, hitting it into glasses of water left by Bo, the liquid scalding its skin. Merrill continues hitting the creature, eventually killing it. Outside, Morgan revives after Graham administers his medication. Morgan's constricted lungs prevented him inhaling the alien's toxins, an act Graham attributes to God's intervention.
Months later, the Hess family has recovered from the ordeal. In the final scene, Graham is seen as having returned to the church, his faith restored.
Mel Gibson as Father Graham Hess, a farmer and former Episcopal priest. His wife Colleen died six months prior. He is Merrill's older brother and father to son Morgan and daughter Bo.
Joaquin Phoenix as Merrill Hess, Graham's younger brother; Colleen's brother-in-law; and uncle of Morgan and Bo. He has been living with the family since Colleen's death; he is a former minor league baseball player.
Rory Culkin as Morgan Hess, the son of Graham and Colleen Hess; older brother to sister Bo; and nephew to Merrill.
Abigail Breslin as Bo Hess, the daughter of Graham and Colleen Hess; Morgan's younger sister; and niece to Merrill; she is the youngest of the Hess family.
Cherry Jones as Caroline Paski, a local police officer and friend of the Hess family.
M. Night Shyamalan as Ray Reddy, a veterinarian; he is responsible for Colleen's accidental death, for which he feels deeply remorseful.
Patricia Kalember as Colleen Hess, Graham's deceased wife and mother of Morgan and Bo; she is Merrill's sister-in-law; she is seen only in Graham's flashbacks and a family photo.
Ted Sutton as SFC Cunningham, an Army recruiter Merrill speaks to.
Merritt Wever as Tracey Abernathy, a pharmacist who makes confession to a discomforted Graham.
Lanny Flaherty as Carl Nathan, the crotchety owner of the bookstore in town.
Marion McCorry as Mrs. Nathan, his patient wife.
Michael Showalter as Lionel Prichard, a local troublemaker.
Clifford David as a Columbia University Professor viewed on television.
Kevin Pires as the Brazilian birthday boy seen in news footage.