In those days Peter stood up among the brethren (the company of persons was in all about a hundred and twenty), and said,  "Brethren, the scripture had to be fulfilled, which the Holy Spirit spoke beforehand by the mouth of David, concerning Judas who was guide to those who arrested Jesus.  For he was numbered among us, and was allotted his share in this ministry.  (Now this man bought a field with the reward of his wickedness; and falling headlong he burst open in the middle and all his bowels gushed out.  And it became known to all the inhabitants of Jerusalem, so that the field was called in their language Akel'dama, that is, Field of Blood.)  For it is written in the book of Psalms, `Let his habitation become desolate,and let there be no one to live in it';and `His office let another take.'  So one of the men who have accompanied us during all the time that the Lord Jesus went in and out among us,  beginning from the baptism of John until the day when he was taken up from us -- one of these men must become with us a witness to his resurrection."  And they put forward two, Joseph called Barsab'bas, who was surnamed Justus, and Matthi'as.  And they prayed and said, "Lord, who knowest the hearts of all men, show which one of these two thou hast chosen  to take the place in this ministry and apostleship from which Judas turned aside, to go to his own place."  And they cast lots for them, and the lot fell on Matthi'as; and he was enrolled with the eleven apostles.
Read Pope Benedict XVI's teaching on the Apostle Mathias in The Apostles