It is extremely difficult to give an ending for this film, or any kind of completion, so here's a synopsis (disclaimer: Everyone I know who had seen this film has had fairly individual and personal reactions towards it. My interpretation of Malick's vision may be far from what others see. All I can say is that this movie is beautiful and moving, and this is my interpretation of it, after seeing it three times)
The movie begins with the Mother (Jessica Chastain) and the Father (Brad Pitt) in their middle years (both remain unnamed throughout the movie), receiving news of their middle child, R.L.'s (I don't believe his name is spoken in the movie, but the script calls him R.L.) death. We see an adult Jack (Sean Penn) wake up in his ultra-modern house. His wife seems concerned about him, but there is no dialogue. They both dress in their business clothing, although she steps outside and pulls a branch off of a tree. Laying it on a kitchen counter, she sees that Jack has lit a blue candle. We see Jack move through his life at work, in some nondescript job, in an office that is giant and full of light, yet without greenery of any kind. He talks briefly to one of his parents, assuring them that he thinks of his deceased brother every day. He sees a tree in a courtyard, gets in a glass elevator, seems lost.
We return to Mother's story. she and Father mourn their child's death in a series of disconnected scenes. Then Mother goes for a walk in the woods. She asks God (or possibly her dead son, the dialogue can be applied either way) where he was and basically, is something like her son's death important, to God/in the grand scheme of things?
This is followed by an amazing sequence of visuals of super novas, galaxies in orbit, sun flares, etc...all showing the turmoil of the universe on a grand scale, in comparison to Mother's loss of a single child. (This sequence is even more amazing, since Malick created the space effects using only practical chemical reactions, filmed at extremely close range, and no CGI in this scene.) The operatic background is beautiful.
We cut then to a series of shots showing the creation of life from single-cellular, to sea-dwelling, ending in dinosaurs (which are totally CGI). One larger dinosaur bullies a smaller, possibly wounded dinosaur for a while, before finally leaving it alive. This possibly parallels Jack's semi-loving/semi-antagonistic relationship with this younger brother later on.
We then start into an examination of Jack's childhood in the 50's. This is all done with very little dialogue, but extremely expressive music. We see Jack's childhood, his interaction with his parents, siblings, and community in Waco, Texas, from the age of birth, to about 14 years old. This is mostly done in small scenes that give us - not so much a sense of a story line, but a sense of the emotions and the personalities of the character themselves:
In the end, Father's job ends, because the plant closes. They have to move away from their house in Waco, to another job up north, leaving the place where they have had their sorrows and joy for so many years. The boys help Father pack the car. They drive away. Mother looks out the back of their station wagons sadly.
We cut to Older Jack stumbling through badlands (in his mind, presumably) to a beach. On the beach, the sun rises, and he meets the members of his family joyously. He holds his (now dead) brother, who is still a child here. He clasps his father's shoulder. He meets his mother, not tired and worn, but young and beautiful. She kisses her husband, embraces Jack, and revels in holding her dead child.
Finally the sun goes down, and Mother symbolically pushes her child out the door, allowing him to move on, then symbolically releases him from her heart with the help of possibly "angels"? Not sure.
Older Jack seems to come back to his life in the elevator with a start. He walks outside, and stands around, inscrutable. There is a shot of glass building below a bright blue sky with clouds, reflecting it perfectly. There is a shot of a bridge. There is a shot of light appearing, possibly in space among clouds of gas (same shot from the beginning).