The landing party encounters a strange obelisk
"The Paradise Syndrome" - a third season episode of Star Trek: The Original Series, and was broadcast October 4, 1968. It is episode #58, production #58
Kirk becomes himself again and flicks his communicator open to contact the ship. As soon as it makes a noise and Kirk says "Kirk to Enterprise", the door to the obelisk is opened. Spock goes inside and repairs the deflector beam. The device targets the asteroid and successfully diverts it away from the planet just minutes before collision. The storm quickly subsides, and 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.
I am Keer-ock!