Star Trek: The Tholian Web

On stardate 5693.2, the starship USS Enterprise NCC-1701 enters an uncharted region of space to answer a distress call from her sister ship, the USS Defiant. Nearing the location, the Enterprise's engines begin to lose power and sensors detect a nearby dimensional fracture in space that seems to be the cause of the energy drain.
The Defiant appears on the monitor, adrift, and with a strange green glow surrounding the hull. Strangely, sensors show no indication that the vessel is there. There are no lifeforms detected, nor are communications established with the ship. Captain Kirk assembles a boarding party consisting of himself, Dr. McCoy, Mr. Spock and Mr. Chekov to beam over and investigate. Before they go, the team dons environmental suits.
They arrive on the Defiant's bridge finding the crew all dead; having killed each other in what appears to have been some kind of bizarre mutiny. McCoy makes his way down to the ship's sickbay, but he can find no real explanation for the crew's deaths. He goes to look at a deceased crewman lying on the floor and suddenly discovers his hands can pass right through the body. In fact, the whole ship's physical structure seems to be dissolving.
As other members of the team notice the Defiant's structure is fading, Kirk orders them to return to the Enterprise. Mr. Scott informs the team that owing to problems caused by the phenomenon, he can only retrieve three of them at once. Kirk decides to remain behind allowing Spock, McCoy and Chekov to return, however his delay causes him to phase away with the Defiant. Kirk now finds himself stuck between two dimensions and floating helplessly in nothingness. Spock rushes to analyze the situation and determines that the Defiant's phasing effect should recur within a few hours. When it does, they may be able to retrieve the Captain if he is still alive.
Meanwhile, the same dimensional interphase begins to affect the Enterprise and her crew. Chekov suddenly goes berserk and attacks Spock on the bridge, and then more violent outbursts occur between crewmembers. McCoy and his personnel rush to find the cause, but they can only assume that the phasing and violent behavior are connected. The same murderous hostilities that affected the Defiant's crew have begun on the Enterprise. McCoy strongly suggests that they put some distance between themselves and the Defiant but Spock refuses, believing any movement from their position could disrupt the Defiant's position and jeopardize finding the Captain.
An hour passes, and unexpectedly, a small vessel of unknown configuration approaches the Enterprise. A crystalline being appears on the bridge monitor that seems to be surrounded by radiant energy. The being identifies itself as Commander Loskene of the Tholian Assembly, and demands that the Enterprise leave their territory immediately. Spock apologizes for their intrusion and explains their situation to Loskene, asking they be given time to retrieve their Captain. Loskene agrees to give the Enterprise 1 hour and 53 minutes, and no more.
The moment comes when the Defiant should phase in again, and Spock attempts to lock onto the Captain; however the ship is not where it is supposed to be. Spock believes the arrival of the Tholian vessel has somehow disturbed the Defiant's position and they have lost Captain Kirk for good.
McCoy and Spock conduct a makeshift funeral in the Captain's quarters where McCoy plays a recording Kirk made for them just in case he was ever killed on a mission. The somber recording gives the officers their final orders and some words of advice for their future missions without him; especially when he exhorts them to use their constant arguments and different points of view to support and help each other.
After the message is heard, Spock orders the Enterprise to leave the area. However, in the midst of her private memorial for Kirk in her quarters, Lt. Uhura notices a ghostly image of the Captain, still in his space suit, and floating inside the ship, beckoning for help. Spock thinks Uhura is seeing things and suggests she report to Dr. McCoy, but then Scotty reports catching a glimpse of Kirk in engineering and confirms that Uhura isn't hallucinating.
Spock rushes to locate the Captain, but Kirk phases out again before he can get a lock. If indeed the Captain is still alive, his pressure suit's life support would be dangerously low and his time is running out.
By now, the Tholians' time limit has already passed, and right on the dime, the aliens attack. Spock returns fire, managing to disable the Tholian ship, but the maneuver leaves the Enterprise critically low on power and Scotty is unable to guarantee survival in event of another attack.
A second Tholian ship arrives on the scene, sure to finish the Enterprise off, but instead, the two alien ships curiously "link up" and begin to extend an energy thread between themselves. Behaving not unlike spiders, they begin to weave the strange energy strands, in a sphere, around the crippled Enterprise.
Spock quickly analyses the "web" filaments and announces that if the Tholians complete their trap, Enterprise will not survive. More reports of Kirk's "ghost" come in from around the ship and Spock tries to lock a tractor beam on him when he appears again. In the meantime, Doctor McCoy has discovered an antidote for the phasing effect by using a diluted form of the Klingon nerve agent, Theragen.
As the Tholian web is nearing completion, Kirk's image is spotted once more and Spock locks onto him with the tractor beam. At that moment, Spock uses all remaining warp energy in the ship's engines to break free of the Tholian's web during the next interphasing. The burst of energy not only releases them, but throws the Enterprise 2.72 parsecs away and well out of range of the enemy ships. Kirk miraculously remains held in the tractor beam and he is quickly transported aboard where McCoy stands ready to inject him with the serum.
Kirk makes a full recovery and is keen on learning what happened aboard his ship while he was "away". He was surprised to learn McCoy and Spock worked well together, and a little disappointed when McCoy claims they didn't have time to open their Captain's "last orders" and his words of wisdom had gone unheard.