The term "in the limelight" was originally used most in circles of early entertainment, and was first introduced in the 1820s by Goldsworthy Gurney, specifically used as...
Literally, it was the chemical reaction with the joining of an "oxyhydrogen flame" introduced into a container (or "cylinder") of calcium oxide (once called "quicklime"). This combination created light that could be directed at an actor, much the way stage lighting today can be focused on one specific character with a spotlight.
Whereas "in the spotlight" means to be the subject of scrutiny or attention, being "in the limelight" also means to be "in the public eye," and while limelighting is not used today, the idiom is still very much in use.
In terms of Sophocles' Oedipus Rex, the King of Thebes is placed in the "limelight" when fire, famine and plagues lay siege to Thebes. It is believed to be a punishment for an unpunished evil, and Oedipus promises to find the cause—the perpetrator—and punish him (or, ostensibly, her).
...the gods caused the plague as a reaction against the murder of their previous king, Laius, and that they want the Thebans to "drive out pollution sheltered in our land"; in other words, to find the murderer and either kill or exile him...
Oedipus has no idea that he is responsible for the tragedy that has befallen Thebes because he inadevertantly killed his father in a chance meeting on the road. Oedipus did not know it was his father because his parents, fearing the prophecy that their son would kill his father and marry his mother, had told a servant to take him out onto a hillside to let him starve to death. A shepherd saves him, and ultimately, he is raised by the King of Corinth as his son, not knowing he was adopted.
When Oedipus searches for answers, he confronts Teiresias, the blind prophet. Teiresias does not want to tell Oedipus what he knows: for the prophet is aware that Oedipus is at fault. Oedipus forces Teiresias to answer him, and the old blind soothsayer delivers words that are abhorent to the King's ears: he has not only killed his father, but married his mother and borne children with her. This instance of incest is deplorable culturally, and Oedipus is repulsed by what he has done. Because Oedipus is central to the calamity that has fallen on Thebes, he is forced into the limelight—first by his promise to discover what is causing death and suffering to his people. Secondly, he is drawn into the limelight because he is responsible for the devastation visited upon Thebes, and will pay the price. Jocasta (his mother/wife) kills herself. Oedipus blinds himself and leaves Thebes.
Ironically, Oedipus forces himself into the limelight by demanding to know who is responsible for all that has happened to the people: he is the man he is searching for.
Limelight or calcium light was once commonly used in theatres to light the stage. Thus the idiom developed.