<P> After Castiel captures Pestilence's ring and Death hands his ring to Dean, both Bobby and Dean reluctantly decide to go with Sam's plan--that is, for Sam to agree to being Lucifer's vessel, then jump into the cage trapping them both in Hell . Upon arriving in Detroit, Sam begs Dean to go live a normal life with his old flame Lisa Braeden and says his goodbyes to Bobby and Castiel . He then proceeds to confront Lucifer, who reveals that he knows about their plan . Seeing no other options left, Sam says yes anyway . A bright light shines and Dean looks upon an unconscious Sam as he opens the portal to Lucifer's prison . Although "Sam" says that he has Lucifer under control, it is shown that Lucifer was just taunting Dean . Lucifer closes the portal and takes the rings before disappearing . At an unknown location, Sam continues to fight Lucifer internally for control over his body . While talking through a mirror, Lucifer tries to persuade Sam to embrace their union by slaughtering demons that were watching Sam throughout his entire life . </P> <P> During Lucifer's confrontation at Stull Cemetery with Michael (using Adam as his vessel), he beats Dean, slamming him against the door of the Impala . As Lucifer is about to deliver a fatal blow, he catches a glimpse of a toy soldier stuck in the car's ash tray triggering Sam's memory of jamming the soldier in there as a boy . The sudden arousal of Sam's childhood memories and those of the bond of brotherhood he shares with Dean allows him to overpower Lucifer and regain control of his body . Sam takes out the rings, reopens the portal, and prepares to throw himself in . Having been temporarily banished by Castiel, Michael returns and attempts to stop him, but Sam jumps in, pulling Michael also with him--trapping both Lucifer and Michael in Lucifer's cage . The ground closes up with a stunned, devastated Dean watching . Later, it is shown that Dean fulfills his promise to Sam and has gone back to find Lisa . As he sits down with her and Ben for dinner, a street light outside goes out, and underneath it inexplicably is Sam secretly watching the three with a blank look on his face . </P> <P> Almost a year has passed since Sam went to Hell, and he reappears to Dean after saving him from Djinn poisoning . Upon their reunion, Sam reveals that he has been back this whole time searching for whatever force brought him back and hunting with his mother's side of the family, the Campbells, led by their grandfather Samuel who was also resurrected . While hunting with Sam again, Dean quickly notices how different he acts . These include using a baby as bait, allowing a child to go through a torturous treatment to gain information, and allowing Dean to become a vampire . After facing the goddess Veritas, Dean and Castiel question Sam's behavior . Castiel then reveals that Sam's soul is not with him and is still trapped in Lucifer's Cage . It is revealed that Crowley brought back Samuel so that they could help him find Purgatory, the afterlife of monsters, and that Samuel has been working for him . Crowley then states that if Sam and Dean help him he will return Sam's soul, but if they do not help him he will send Sam back to Hell . Although Sam still retains his memories, likes, dislikes, and is capable of making rational decisions, he is completely without emotion and appears almost inhuman . </P> <P> Upon Dean's request, Death retrieves Sam's soul from the Cage and returns it to him at the end of the sixth season's mid-season finale "Appointment in Samarra". He gives Sam's mind a "protective wall" to prevent any negative effects it might have on him otherwise, but Death also warns him not to scratch at the wall he has built, or his memories from Hell will destroy him . However, Castiel, in an attempt to distract Dean and Bobby while he attempts to enter Purgatory, brings down the wall, ultimately causing Sam to remember his time in Hell . In the season finale, Sam spends much of the episode attempting to recoup his shattered soul, including the memories of his soulless self and tortured self . Once complete, he reawakens, though still struggling with the visions of the Cage that his soul endured . </P>

How did sam get out of lucifer's cage