This is very interesting. According to the Summa Theologia, a layman may hear a confession in necessity when a priest is not available. Below is the answer to the question, "Whether it is ever lawful to confess to another than a priest?" from the Summa Theologia Supplementum Tertiæ Partis, 8, 2. Granted this is from the Supplement which was collected/edited after Thomas died.
I answer that, Just as Baptism is a necessary sacrament, so is Penance. And Baptism, through being a necessary sacrament has a twofold minister: one whose duty it is to baptize, in virtue of his office, viz. the priest, and another, to whom the conferring of Baptism is committed, in a case of necessity. In like manner the minister of Penance, to whom, in virtue of his office, confession should be made, is a priest; but in a case of necessity even a layman may take the place of a priest, and hear a person's confession.What think ye?