B.O.T. begins with a happy occasion: a wedding. Two members of the crew- a Lt. Tomlinson and Lt. Martine- are getting married, with Captain Kirk performing the ceremony. Unfortunately, before they can tie the knot, there is a red alert, and Kirk is called to the bridge. Three outposts along the Neutral Zone have been destroyed, and a fourth is under attack. The Neutral Zone is a stretch of neutral space separating Federation controlled space from Romulan territory. It was established one hundred years before at the end of the war between Earth and the Romulans, and entrance into it by either side is considered an act of war. As the Enterprise answers the call, there are fears that the Romulans have violated the zone. In the event that this proves true, Kirk's orders from Star Fleet Command are that under no circumstances is the Neutral Zone to be violated. The Enterprise can defend itself, but, if necessary to prevent war, the outposts and the ship are considered expendable.
Still out of range of Outpost Four, they manage to establish visual contact. The outpost has been reduced to rubble, its commander, Hansen, the only person still alive. He tells them that the attack came from a ship that was unseen until it appeared long enough to fire on them, and then disappeared again. While he's giving his report, the attacking ship reappears. The Enterprise attempts to contact them and warn them off, but there is no reply. Too far away to do anything, Kirk and his crew are forced to watch helplessly as the ship completes the destruction of the outpost, then disappears again.
Spock observes that the unknown ship only became visible right before it attacked, and Kirk speculates that perhaps they must do so to fire their weapons. He asks Spock how this seeming invisibility could be achieved, and Spock says that it is technically possible, but would require tremendous amounts of energy. While unable to get a visual lock on them, Spock manages to detect a faint sensor reading, which could be the ship. Spock reports that it is moving at a leisurely pace, as if unaware of the presence of the Enterprise. Kirk guesses that the invisibility may work both ways- that the huge amount of power needed for it may hinder their ability to detect other vessels. Monitoring the 'blip', Spock notes that it is headed for the Neutral Zone, the exact course that a Romulan ship would take to return home. Kirk orders Sulu and Stiles to match the course and speed of the other vessel, so that if they do have sensors, they may think the Enterprise is just a reflection.
At this point, the action switches over to the Romulan bridge, where the commander is reprimanding one of his men for dropping out of cloak while they're in Federation territory and being pursued. The crewman says he was trying to conserve energy, and that he and the others think they're running from a reflection. The commander is not convinced, and orders him to reengage their cloaking device. He then chews out another crewman for breaking radio silence to send the coded message to Romulus, reporting their victory. The commander shows himself to be a shrewd and ruthless foe, but in conversation with his centurion, we see another side of him. Disillusioned and sick of the endless empire building wars, he regrets their easy victory over the outposts. He knows that it will encourage their Praetor to attempt an invasion of Federation space, leading to yet another war. Tired and bitter, he almost wishes that the Federation ship would destroy them, but reassures his friend that he is too good a soldier to let that happen.
Surprisingly, Spock sides with Stiles: he thinks they should attack. He says that Vulcan had an aggressive colonizing period in their history before they embraced logic. He speculates that, if the Romulans are an offshoot of the Vulcans of this period, who retained these violent tendencies, then the Federation has no choice but to respond forcefully. Dr McCoy is aghast, demanding to know if Spock wants a galactic war on his conscience. Kirk doesn't have much time to weigh his options: the Romulan ship will reach the Neutral Zone in 20 minutes. He also can't consult Star Fleet command, as the earliest he can expect a reply to his previous report is another three hours. Spock reports that the Romulan ship has altered course and will be passing through the tail of a nearby comet. Realizing that, though invisible, the Romulan vessel will leave a trail while passing through it, Kirk decides to seize the opportunity and attack. He orders the crew to battle stations.
Speaking of Kirk, he now faces the dilemma of either letting the Romulans escape, or violating the Neutral Zone against orders, risking outright war. Hoping to stop them before they reach it, the Enterprise bombards the area once again with phaser fire. They manage another hit, but it's not serious, and the Romulans continue to the Zone. Kirk tells Uhura to send a message to Star Fleet, saying that, on his responsibility, they are entering the Neutral Zone. The Romulan commander doesn't return fire, realizing Kirk has estimated that they only have enough power to return home, and is trying to make them waste it. Instead, he orders all their debris to be jettisoned- including the centurion's body- to try to fool the Enterprise into thinking they've been destroyed. It doesn't work, as Spock informs Kirk that there is insufficient mass for the debris to be the ship. It does, however, distract them long enough for the Romulans to disappear, the Enterprise even losing the 'blip' they had been following. Sure that the enemy is nearby, Kirk orders all systems shut down, trying to remain undetected and wait out the other ship, which is doing the same.
Returning to the bridge, Kirk continues the blackout until Spock, working on repairs, accidentally turns on one of their systems, alerting the Romulans to their position. Stiles of course thinks that this is a deliberate attempt to warn them. Noting the power surge, the Romulan commander orders his men to attack. Kirk, however, deduces where they will attack from, and orders Stiles to fire on that position. The Romulan ship is again hit and badly damaged. The commander once again orders a debris dump, and tells his men to put a nuclear warhead in with it this time. Scanning the floating rubble, Spock detects the bomb, and Kirk immediately orders Sulu to veer off, at the same time firing on the warhead. They manage to destroy it in time, but the Enterprise sustains some heavy damage. Phasers are operational, but due to injuries and repairs, Lt. Tomlinson is left manning weapons control alone. Since Stiles used to work in that department before promotion, he is sent down to help. The Enterprise also has engine capabilities and could move off, but Kirk decides to play dead, hoping to draw the Romulans back to their side of the Neutral Zone.
Back on the Enterprise, Spock checks on the repairs being done in weapons control. He asks Stiles if he and Tomlinson need any help, but Stiles rudely repudiates the offer. After Spock leaves, however, a coolant system begins spewing poisonous gas and the two men rush to try to stop it. At this moment, the Romulans attack, and Kirk orders phasers to fire. They don't. Spock hears Kirk trying to raise a response from Stiles, and rushes back to weapons control. The room is now filled with gas, but Spock fights his way through it, activates the phasers, then drags Stiles out of the room. Hit by the Enterprise's phasers at point blank range, the Romulan ship is hopelessly crippled. Kirk contacts the commander and tells him they will beam his surviving crew aboard the Enterprise.
After this, Kirk makes his way to sickbay, checking on Spock and a chastened Stiles, who tries to thank Spock for saving his life. Spock tells him that it was the logical thing to do. Kirk asks McCoy how many men they lost, and McCoy tells him just one: Tomlinson, the man who had been going to get married that morning. As Kirk starts to leave, Yeoman Rand comes in to inform him that they finally heard from Star Fleet Command, who said they would support whatever decision Kirk made. He pauses to smile ironically at the other men, then heads to the chapel, where he finds Lt. Martine. As she leans on him for comfort, Kirk tells her that, "It never makes much sense, but you have to know there was a reason." She pulls herself together and tells him she's alright. After she leaves the chapel Kirk stays for another minute, staring grimly into space, then strides purposefully off down the Enterprise's corridor.