Star Trek: The Paradise Syndrome

On stardate 4842.6, the starship USS Enterprise arrives at an Earthlike planet on the verge of a collision with an asteroid that will surely destroy it. Captain Kirk beams to the surface along with his first officer Mr. Spock and chief medical officer Dr. McCoy, for a 30-minute investigation. They find the planet's terrain breathtaking, with snow-capped mountains, thick pine forests and a sparkling blue lake.
The team then comes across an ancient obelisk of unknown origin. The structure is comprised of a mysterious metal that resists sensor scans and is covered with strange alien writing. They also discover a group of primitive humanoids living nearby whose customs and appearances closely resemble North American Indians; more specifically, a mix of Mohican, Navaho and Delaware tribes.
The team returns to the obelisk and Kirk goes to relay their findings to the ship. He flips open his communicator and something about the action trips a trap door at the base of the structure. Kirk falls inside. The strange machinery housed within zaps him with a bolt of energy that knocks him unconscious and renders him amnesic. The trap door quickly seals shut leaving Spock and McCoy unable to find their Captain. With too little time to conduct a search, the remaining party returns to the ship which quickly leaves orbit in an attempt to intercept the asteroid and deflect it off its deadly course.
Meanwhile, Kirk recovers but has no idea who he is or what his equipment does. He finds a way out and emerges from the obelisk, but is discovered by a group of natives, young women who are leaving an offering at the "temple". Among them is Miramanee, the chief's daughter and tribal priestess. They immediately mistake him for a god and bring him to their village, but the tribal elders are doubtful of Kirk's "divinity" and demand that he prove himself.
At that moment, an unconscious boy is rushed to the village. The child, who has fallen into the lake, is not breathing. Although Salish, the village medicine chief, pronounces the child dead, Kirk rushes over to help. Recalling his first aid skill of mouth-to-mouth resuscitation, he revives the child. The tribe elders look on in awe and believe Kirk has performed a resurrection, proving that he is indeed a god. The elders force Salish to give up his position as a healer. He angrily throws down his emblems. The elders ask Kirk his name; he tries to remember, but it comes out "Kirok". They accept this as his name and make him the new medicine chief, as Salish jealously walks away.
Back in space, Spock orders the Enterprise to intercept the asteroid at the highly dangerous speed of Warp Nine. Arriving at the asteroid, it attempts to push the huge rock to a benign course. A deflector beam is used in conjunction with warp drive propulsion, further taxing resources. Spock then orchestrates sequential blasts from the ship's various phasers, but the beams only manage to blast chunks loose as the ship strains to maintain power. In an act of final desperation, the Vulcan Commander orders simultaneous bombardment with all phasers. The resulting energy demand completely wrecks the exhausted warp drive, and the asteroid remains on its lethal course. Mr. Scott announces that he cannot repair the star drive without putting into a starbase. Having failed to stop the asteroid, Spock begins to blame himself. He orders the Enterprise to return to the planet on its auxiliary impulse power; it will take them just short of two months to get back, with the asteroid four hours behind, all the way.
Meanwhile, Salish's anger for Kirk grows. Tradition holds that the medicine chief and the tribal priestess must always be husband and wife. Now that Kirk is medicine chief, Miramanee must marry him instead. She is clearly attracted to Kirk over and above traditional duty, and Salish is disgruntled over this and argues violently with her. Kirk accepts Miramanee's offer to "settle" with him, and she asks him to pick the day of "joining" where they will be married.
Not remembering the imminent doom of the asteroid, Kirk picks the following day for the ceremony. On his way to the joining he is attacked by Salish, who cuts his hand. Salish notices that Kirk can bleed, and therefore he cannot be a god ("Behold a god who bleeds!"). He denounces Kirk's godhood before the rest of the tribe, but the villagers still believe Kirk to be a deity.
Following the joining ceremony Miramanee quickly becomes pregnant. Kirk tells her he'd like to stay, but that he is unable to shake off his dreams of "the strange lodge which moves through the sky", and that he feels that is where he truly belongs.
Meanwhile, over the two-month period it takes to return to the planet, Spock works on the translation of the obelisk's symbols. He theorizes the obelisk may have been placed on the planet as an "asteroid deflector" built by the ancient Preservers, who are believed to have seeded the galaxy with humans (particularly groups that seemed to be in danger of dying out) thousands of years ago. The asteroid deflector was designed to protect them in a high-risk star system. Spock concludes that the device has ceased to work properly, unaware that Salish's father knew the means by which to enter the "temple", but died before he could pass that secret on to his son. Spock determines that the only hope of saving the planet is to somehow activate the deflector. He eventually realizes that the symbols aren't words but musical notes; a possible activation code of some kind.
As the asteroid approaches, the planet's sky begins to darken and the weather begins to pick up force that blasts the terrain with fierce winds. The elders tell Kirk he must go to the "temple" and stop the storm before "the ground begins to tremble". Kirk makes his way to the obelisk, but doesn't remember how to get inside. He pounds his fists against the sides of the obelisk, shouting, "I am Kirok! I have come! I am Kirok!", but nothing happens.
Salish witnesses Kirk's failure to get into the "temple", and turns the tribe against him. With his encouragement, they begin stoning Kirk. Keeping her faith in Kirk, Miramanee throws herself in the line of fire to stop the attack, but she is mortally injured. Just then, Spock, McCoy and Nurse Chapel beam in, which frightens the villagers away. McCoy rushes over to Kirk to treat his injuries and discover he has no recollection of who they are. Spock uses a Vulcan mind meld to restore his mind while McCoy checks on Miramanee.
Kirk becomes himself again and flicks his communicator open to contact the ship. As soon as it makes a noise, the door to the obelisk is opened. Spock goes inside and repairs the deflector beam. The device, employing power exponentially greater than that of the Enterprise, targets the asteroid and successfully diverts it away from the planet, just minutes before collision. The storm quickly subsides. Later, in the lodge where Kirk and Miramanee had lived, McCoy tells Kirk she suffered internal injuries, and will not survive. Moments later, Miramanee dies in Kirk's arms.