Spectre of the Gun ( episode ) Captain Kirk , Mr . Spock , Dr . McCoy , Scotty , and Chekov are forced to re - enact the gunfight at the O . K . Corral in Tombstone as the team that lost the gunfight . Summary . Teaser . On a mission on behalf of the Federation to establish contact with the reclusive and xenophobic Melkot ians , Captain Kirk decides to ignore the message of a space buoy warning the " Enterprise " to immediately withdraw from Melkotian space and go back the way it came . It speaks this warning in Vulcan , English , Russian , and Swahili , which Spock , Kirk , Chekov , and Uhura hear in their own individual languages . Kirk orders Uhura to further contact the Melkotians , but there is no response to his hails . When Spock , Kirk , Scott , Doctor McCoy , and Ensign Chekov beam down to Melkot , they materialize in a fog bank not recorded by sensors . Their tricorder s and communicator s do not function . The landing party encounters a Melkotian . The Melkotian emerges from the fog and tells the " Enterprise " officers that their warning was plain , they have disregarded it , and will now be punished . Act One . The Melkotian informs them that they are " outside " – a disease that must be destroyed . They learn that their trespassing is to be punished by death and how they will die will be taken from Kirk ' s mind , since it was he who ordered that the Melkotians ' warning be disregarded . The Malkotian tells Kirk that " " yours shall be the pattern of your death . " " The landing party suddenly finds itself teleported to a facade of a 19th century American frontier town . All of their equipment is gone , and instead each now has a gunbelt and a revolver . They observe the curious " incompleteness " of the town . Buildings with only a front wall , open to the air on the sides and back , signs and clocks hanging in mid - air . Kirk reads from a copy of the Tombstone Epitaph , a newspaper with the date of October 26th , 1881 . Kirk wonders " Why here ? And why now ? " . Spock notes that the time and place is based on the patterns of Kirk ' s memories . A man with a sheriff ' s badge greets them , acting as though he knew them well . He refers to Kirk as Ike , Spock as Frank , Scott as Billy , and McCoy as Tom . Recognizing the sheriff ' s name , Johnny Behan , Kirk quickly puts the names together . Ike Clanton , Frank McLowery , Tom McLowery , Billy Claiborne and Billy Clanton . He further recalls that the Clantons were one of the factions who fought for control of the town of Tombstone ; the other being the Earps : Wyatt , Morgan , and Virgil , who were the town marshals , as well as " Doc " Holliday . Spock notes that the famous gunfight of O . K . Corral took place on October 26 , 1881 and that the Clantons lost . Kirk warns that the antique guns they all are carrying can be as deadly as phasers at close range . They witness the shooting of a bar patron by Morgan Earp , and conclude that death is one thing that is real in this surreal scenario . Inside the bar , Chekov is accosted by a woman named who claims to know him as Billy . Kirk recognizes Morgan as the man who kills on sight , and rises to confront him . Spock cautions him to back down , without moving a muscle , as he would be quickly gunned down in a " fast draw . " Kirk says he does not want any trouble from Earp , but Earp says he will get them to draw soon enough , and then leaves . Kirk and Spock discuss what is expected to happen based on history , that they are supposed to be killed at the OK Corral at 5 pm . Kirk says that they will not be there . Kirk tries to convince Ed the bartender vehemently that he is not Ike Clanton , that he and his group are from the future , Kirk is the captain of a starship , but to no avail . The bartender tells him it makes no difference who he thinks he his , but rather whom the Earps think he is , while walking away still laughing . Kirk then attempts to make peace with the Earps , saying there is a mistake . Virgil Earp says that he always felt the Clantons were " yellow " and then hits Kirk . Kirk strikes him back , Wyatt Earp then draws on Kirk , but Virgil stops him . Wyatt Earp warns Kirk that if he is in town at 5 : 01pm , the Earps will kill them . Act Two . Kirk returns to the bar , and discusses what options they have with Spock , McCoy and Scotty . Kirk and the landing party try to leave town , but they are stopped by a force field . Spock notes that the Melkotians will not allow them to leave . Recognizing that they must fight , Kirk asks if they can find some way to stop the Earps using materials at hand in this recreation of Tombstone . McCoy and Spock cooperate to build a tranquilizer gas grenade which will incapacitate the Earps . McCoy encounters the town dentist , " Doc " Holliday , while acquiring the chemicals needed for the tranquilizer , asking to borrow a small quantity for a serious emergency . Holliday tells McCoy that his " emergency sure is real , " and lets him take the chemical , but warns him to be finished by 5 : 00pm , because at " one minute past five , you ' ll find a hole in your head . " Meanwhile , Chekov has fallen in love with Sylvia , telling her that he is looking forward eagerly to the dance next week . Sylvia asks if they can turn the dance into a wedding ball , but Chekov says that would not be possible , because he is not someone she could marry . The two share a passionate kiss , but then Morgan Earp appears and knocks Chekov down , and starts to walk Sylvia away . When Chekov gets up and tells Morgan to get his hands off of her , Chekov draws for his gun , then he is shot and killed by Morgan . Kirk , Spock , McCoy , and Scotty appear as do the Earps . McCoy examines Chekov and tells Kirk that there is nothing he can do . Wyatt tells Kirk to " " do it now , " " and Scotty says that they must do something . Kirk however says that it ' s not yet time and they are not prepared . Act Three . Back in the bar , McCoy and Spock work on the gas grenade . McCoy and Scotty give Spock a hard time for not showing any feelings over Chekov ' s death , as Scotty points out , he and Chekov worked closely together on the " Enterprise " . Kirk asks the two of them to stop but Spock notes that they forget he is half - Human . Spock observes that Chekov as Billy Claiborne died , but in the actual gunfight at the OK Corral , Billy survived . Kirk takes it to mean that the outcome of the conflict does not necessarily correspond with the historical outcome . Kirk finds the sheriff and asks him to stop the fight , but Behan says that no one wants to stop the fight , and that it is a little late for Kirk to decide he " does not have the belly " for it . The sheriff tells Kirk that the people in the town are counting on Kirk to get rid of the Earps for them , and that no one would deny them their revenge for killing Billy . Kirk angrily says they just can ' t just kill them , but the sheriff says that there will be no questions asked as Kirk puts his hands around his neck . Upon seeing he will get no help from the sheriff , Kirk walks away . With time running out , Scotty volunteers to test McCoy and Spock ' s gas grenade . Despite McCoy and Spock ' s careful preparation , it does not work , even when Scotty deeply inhales it . Spock finally realizes that nothing around them is real and that the entire scenario has been taking place in their minds . Kirk vows not to leave the bar until " well after 5 o ' clock " , but suddenly finds himself and the others teleported to the O . K . Corral where they cannot leave either , as it is surrounded by force fields . Act Four . The corral is encircled by a force field so that escape is impossible . Spock tries to convince the others that if they recognize that the situation is not real , they will not die and Kirk observes that the " smallest doubt " would be enough to kill them , just as it had killed Chekov . McCoy argues that they don ' t have that " clockwork ticker " in their heads like Spock , that they can ' t just turn it off and on at will . Kirk says that they must . Using a mind meld , Spock is able to convince everyone else that the bullets are not real , they are merely " shadows " and " illusions , " " spectres without body . . . to be ignored . " The Earps arrive and demand that the ersatz Clantons draw , but the landing party refuses . The Earps begin shooting when Kirk reaches for his gun , but the bullets harmlessly pass right through the landing party , hitting the fence behind them . When the Earps deplete their ammunition , Kirk attacks Wyatt Earp and knocks him to the ground . Kirk draws his gun , and is about to shoot him , but upon seeing the abject terror in Wyatt ' s eyes , he releases him . Suddenly , the landing party finds themselves back on the bridge of the " Enterprise " . Chekov is alive and well , sitting at his station , and wonders " where have I been ? " Kirk suggests they have been on the bridge the whole time , and that Chekov survived because the only thing that was real to him was the girl . The Melkotian buoy , once again directly in front of them , begins to emit M - ray s beyond measurable levels , and then explodes . A Melkotian appears on the main viewer screen , noting that Kirk did not kill . Kirk explains that they fight only when there is no choice , and prefer peaceful contact . The Melkotians extend an invitation to establish relations with the Federation , and asks Kirk to send a delegation to the planet . Spock then asks Kirk a " personal " question : did he actually want to kill the Earps ? Kirk agrees that is exactly how it was that afternoon , and how it was in 1881 . Spock wonders how Humanity managed to survive . Kirk says that Humans overcame their instinct for violence , receiving a doubting look from Spock as he moves back to his console . The " Enterprise " then begins its orbit of Melkot . Memorable quotes . " " History cannot be changed . " " " " Is this a dead man , doctor ? " " " " Very dead , Mr . Spock . " " " " What can I do , Captain ? You know we ' re always supposed to maintain good relations with the natives . " " " " I always said you was yellow , Clanton . " " " " I ' ll make one more attempt to get through to you , Mr . Earp . My name is not Clanton ; it ' s Kirk . " " " " Oh , yeah . We heard the talk about your jokes . " " " " I ' m not joking . " " " " Sure . Well , I ' m glad to meet you , Mr . Kirk ! " " " " We don ' t want any trouble . We ' ll be glad to co - operate . " " " " Five o ' clock , Clanton . Is that clear ? If you ' re in town at 5 : 01 , we ' ll kill every one of you whether you draw or not . Is that clear ? " " " " A lot of people and things have tried to kill me . You ' d be surprised . " " " " Captain , it ' s quite all right . They forget I am half Human . " " " " It ' s to kill the pain . " " " " But this is painless . " " " " Well , you should ' ve warned me sooner , Mister Spock . Fire away . " " " " Physical reality is consistent with universal laws . Where the laws do not operate , there is no reality . " " " " Ten minutes , and it ' s all going to end at the OK Corral . Well , we ' re going to wait right here until well after five o ' clock . We ' re not going to move from this spot ! " " " " We don ' t have that clockwork ticker in our head like you do . We can ' t turn it on and off . " " " " Draw ! " " " " I wonder how Humanity managed to survive . " " " " We overcame our instinct for violence . " " Links and references . References . 1880 ; 1881 ; alloy ; American frontier ; apothecary ; Arizona ; baking soda ; bartender ; " Bones " ; bourbon ; bullet ; Buntline Special ; cactus ; cattle ; ; Clanton gang ; ; ; clock ; clockwork ; Colt ; communicator ; corn whiskey ; Cossack ; cotton wadding ; dance ; dentist ; disease ; dizziness ; double - barreled shotgun ; Earp gang ; Earth ; Earth history ; English ; fast draw ; first contact ; fog ; force field ; furnishing ; gallon ; gas grenade ; gown ; gun ; handgun ; Hell ; horse ; humanoid ; instinct ; intercept ; joke ; kilometer ; Kirk ' s ancestors ; label ; lead ; leather ; M - ray s ; marriage ; marshal ; ; ; medicine ; Melkot ( ian ) ; Melkotian buoy ; Melkotian homeworld ; memorial ; metal ; mile ; mortar and pestle ; muscle ; October ; OK Corral ; OK Corral , Battle at the ; palpitation ; phaser crew ; phaser gun ; physical law ; physician ; pioneer ; poison ; power source ; reality ; red alert ; revolver ; ; Russian ; rustler ; science officer ; scotch ; scurvy ; sense s ; shadow ; shave ; Sheriff ; shopping bag ; Skipworth and Co ; snake ; standard orbit ; stomach ; Swahili ; sweating ; Taos lightning ; telepathy ; thief ; Tombstone ; " Tombstone Epitaph " ; town marshal ; tranquilizer ; transporter ; tricorder ; United Federation of Planets ; United States of America ; venom ; Vulcan language ; Vulcan mind meld ; wedding ; wedding ball ; wedding gown ; yard ; xenophobia