Shades of Gray (Star Trek: The Next Generation)

"Shades of Gray" is the twenty-second and final episode of the second season of the American science fiction television series Star Trek: The Next Generation, the 48th episode overall. It was originally broadcast on July 17, 1989, in broadcast syndication. It was the only clip show filmed during the series, and was created as such to meet a budget shortfall at season's end due to prior episodes that had cost overruns.

Set in the 24th century, the series follows the adventures of the Starfleet crew of the Federation starship Enterprise NCC 1701-D. In this episode, Commander William Riker (Jonathan Frakes) undergoes medical treatment by Dr. Katherine Pulaski (Diana Muldaur) for an alien infection and must relive numerous past events.

It was the final episode written by Maurice Hurley, who originated the idea and wrote the first draft of the script, with Hans Beimler and Richard Manning conducting re-writes. It was directed by Rob Bowman and the framework sequences were filmed over the course of three days. It was watched by 9.8 million viewers on the first broadcast, the highest ratings for the series since "Samaritan Snare" two months earlier. "Shades of Gray" is widely regarded as the worst episode of the series, with critics calling it "god-awful" and a "travesty"; even Hurley referred to it negatively.

It was the last appearance of Dr. Katherine Pulaski (Diana Muldaur). It is also the final episode to regularly feature the original Type A TNG Starfleet uniforms, which were introduced in Season 1.

Plot
During a geological survey on Surata IV, Commander William Riker is struck by a thorn growing on a motile vine plant. The away team immediately beams back to the Enterprise, where Dr. Katherine Pulaski finds out that the thorn has released a deadly virus into Riker's body. Within a matter of hours, the virus will reach Riker's brain, killing him. To try to save Riker's life, Pulaski puts him into a machine that will artificially stimulate his brain neurons, keeping them active and resisting the virus. This causes Riker to dream of his past adventures aboard the Enterprise. Riker's first dreams are of reasonably neutral occasions, such as his first meeting with Lieutenant Commander Data. He soon moves on to more passionate and even erotic dreams, such as meeting the cheerful young Edo women on Rubicon III, the matriarch Beata on Angel One, and the computer-generated holodeck woman Minuet (Carolyn McCormick from "11001001").

However, while pleasing to Riker's mind, the passionate dreams only worsen Riker's condition, as the virus feeds on the positive endorphins his brain is creating. Pulaski and Counselor Deanna Troi therefore agree to try to make the machine evoke negative dreams instead. Thus Riker dreams of Lieutenant Tasha Yar's death, and the apparent death of Deanna Troi's child. This has the desired effect, as the negative endorphins drive the virus away, but the endorphins are not strong enough. As a last resort, Pulaski uses the machine to evoke dreams of raw, primitive feelings of fear and survival. Thus Riker dreams of fighting the tar creature Armus, the alien-controlled Admiral Gregory Quinn, and the Klingon officer Klag on board the warship Pagh. Seeing that the raw emotions work best, Pulaski intensifies the dreams to come at a more rapid pace. This finally kills the virus and Riker recovers.

Production
The episode was intended to save money at the end of the season by being a bottle episode which featured few additional characters. The only guest star was Colm Meaney as recurring character Chief Miles O'Brien. The reason was that the show had overspent on the episodes "Elementary, Dear Data" and "Q Who", and Paramount Pictures was holding the series to their overall season budget. It was the last episode on which Maurice Hurley acted as head writer; he referred to the episode as a "piece of shit" and "terrible, just terrible". He turned in the idea of a cheap clip show to save money and wrote the first draft of the script, with Richard Manning and Hans Beimler conducting re-writes.

Director Rob Bowman initially thought that the episode could be filmed in five days, two fewer than usual. However, it was actually filmed in three days after pressure from Paramount with two spent only on the sickbay set. He later said that he simply shot the framework for the clips to be added in later, and never saw a final cut of the episode. Production assistant Eric A. Stillwell was responsible for selecting the clips that went into the episode, with 21 different clips included. The prop used on Riker to fight the infection was created from drawings by designer Rick Sternbach.

Ron Jones created the music for the episode, including a three note motif to represent the virus that infects Riker. Themes build as the episode progresses, with elements from "Infection Spreads" which is played over the scene between Riker and Troi move into the pieces "Shades of Pleasure" and "Earth Boys Are Easy" which is played over the pleasurable memories. String instruments and flutes are added to "Shades of Sadness" which played over the unhappy memories, before it built to a climax in the intense memories in the pieces "Critical Condition", "Shades of Conflict" and "Final Intensities". Several scenes retained the compositions from the episodes, including pieces by Dennis McCarthy, while others by McCarthy were re-composed by Jones.

Broadcast and reception
"Shades of Gray" was first shown on July 17, 1989 in broadcast syndication. It was the final episode of the second season and was watched by 9.8 million viewers on the first broadcast. It was the highest number of viewers for an episode since "Samaritan Snare" some two months prior.

Several reviewers re-watched the episode after the end of the series. In 2011, Keith DeCandido watched "Shades of Gray" for Tor.com, and admitted that he hadn't seen the episode since the original broadcast. He said that it was a "trainwreck" and even worse than he remembered, because other shows such as Xena: Warrior Princess and Stargate SG-1 had since done much better clip shows. DeCandido summed it up by saying that "In all honesty, they’d have been better off doing one fewer episode — the season was shortened by the writers strike anyhow — and upping the budget on one of the other 21. Just an awful, awful episode." He gave the episode a score of zero out of ten. In 2010, Zack Handlen reviewed the episode for The A.V. Club, describing the script as "god-awful" and the episode as "forced".

Michelle Erica Green in her review for TrekNation called the storyline "absurdly flimsy" and that the episode "just felt lazy on every level". She cited The Original Series episode "Operation -- Annihilate!" and the Voyager episode "Resolutions" as better episodes featuring alien infections. In the list of the five worst Star Trek: The Next Generation compiled by TechRepublic writer Jay Garmon, "Shades of Gray" was listed as the worst. Garmon described it a "travesty" and that the "nicest" thing you could say about the episode was that it was the last time there was a flashback episode in the series and the last appearance of Pulaski. It was also the original choice of worst episode by Empire magazine, but it was decided that it didn't count because it was a clip show – so "Masks" was chosen instead.

In 2016, fans at the 50th anniversary Star Trek convention voted "Shades of Gray" as the fifth worst Star Trek episode, of any series, and the second worst episode of this series, with only "Code of Honor" faring worse. In 2017, this episode was rated the 7th worst episode of the Star Trek franchise up to that time, by Screen Rant, and explained several issues with the episode including a lack of meaning in the clip segments. In 2019, they ranked it the 6th worst episode of the franchise based on IMDB rankings. Ars Technica and ABC News Australia noted that "Shades of Grey" had by far the lowest IMDb rating of any episode in the franchise. Ars Technica pointed out it had been "hobbled" by the 1988 writer's guild strike, and did not include it among what they considered to be the five worst episodes of the series.

Home media
The first home media release of "Shades of Gray" was on VHS cassette, appearing on October 12, 1994 in the United States and Canada. The episode was later included on the Star Trek: The Next Generation season two DVD box set, released in on May 7, 2002. The episode was released as part of the season two Blu-ray set on December 4, 2012.