Theoretically speaking, any baptized male Catholic can be elected pope. Were such a layman elected, he would immediately be ordained and made a bishop (because the pope is the Bishop of Rome), thus making him able to celebrate Mass.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.