Procedure and Requirements
The spell must be performed during a lunar eclipse. The spell required the blood of a Purgatory native and a virgin in order to work. An intricate sigil is drawn using the blood. The sigil would act as the doorway. Once the sigil is in place, the incantation must then be recited.
The incantation is as follows, "Ianua magna Purgatorii, clausa est ob nos, lumine eius ab oculis nostris retento. Sed nunc stamus ad limen huius ianuae magnae et demisse, fideliter, perhonorifice, paramus aperire eam. Creaturae terrificae, quarum ungulae et dentes, nunquam tetigerunt carnem humanam. Aperit fauces eius ad mundum nostrum, nunc, ianua magna aperta tandem!"
English translation, "The great door of Purgatory was closed to us, with its light held back from our eyes. But now we stand at the threshold of this great door and humbly, faithfully, very honorably, we prepare to open it. Terrible creatures whose hoof and teeth have never touched human flesh, open its (Purgatory's) jaws to our world. Now the great door is open at last!"
This spell was attempted by Crowley and Raphael, although they failed due to them unknowingly using dog blood. The blood they intended to use has been kept by Castiel for himself, as he performed his own attempt. Castiel was successful, and after absorbing all the souls, killed Raphael and declared himself to be the new God.
Castiel later had to return the souls, as he could no longer contain the vast amount of power of the souls as well as the number of leviathans inside him. With the assistance of Death, Sam , Dean and Bobby, they performed the ritual for Castiel to return the souls.