"And Phinehas son of Eleazar was priest in those days" (Judges 20:28). Our Rabbis taught: How does one inquire by the Urim and Tumim? The inquirer turns his face toward the one being asked [the priest], and the one being asked turns his face toward the Divine Presence. The inquirer says, "Shall I pursue after this troop? Shall I overtake them?" and the one being asked answers, "Thus says the LORD: Go up and succeed." Rabbi Yehudah says: He need not say to him "Thus says the LORD"; rather, only "Go up and succeed." One does not inquire aloud, as it is said, "and he shall inquire for him" (Numbers 27:21); nor does one merely think it in his heart, as it is said, "before the LORD" (ibid.). Rather, as Hannah spoke in her prayer, as it is said, "And Hannah, she was speaking in her heart" (1 Samuel 1:13). One does not inquire about two matters at once, and if he did inquire, he is answered only the first, as it is said, "Will the citizens of Keilah hand me over?" and so forth (1 Samuel 23:11-12). But did you not say he is answered only the first? Rather, David inquired out of order and was answered in order, so he asked again in proper order. And if a matter required both answers, both are returned to him; and if it required one, one is returned, as it is said, "And David inquired of the LORD" (1 Samuel 30:8). And even though a prophet's decree may be revoked, the decree of the Urim and Tumim is not revoked, as it is said, "by the judgment of the Urim" (Numbers 27:21). Why are they called Urim? Urim, because they enlighten the eyes [me'irin, from or, light] in halakhah for all their words. Tumim, because they fulfill [mashlimin, complete] their words. And if you should say: At Gibeah of Benjamin, why did they not fulfill their words? It was because they did not inquire whether they would prevail or not prevail; in the end, when they did inquire, the answer agreed and was fulfilled for them, as it is said, "And Phinehas son of Eleazar was priest," and so forth. How do they function? Rabbi Yochanan says: The letters protrude. Resh Lakish says: The letters join together. But the letter tzadi is not written there? Rabbi Shmuel bar Rav Yitzchak said: "Abraham, Isaac, and Jacob" are written there. But the letter tet is not written there? Rabbi Acha bar Yaakov said: "The tribes of Jeshurun" are written there. Our Rabbis taught: A High Priest serves in eight garments, and through these one inquires of the Urim and Tumim. They are not consulted for a commoner, but only for a king, for a court, and for one whom the community needs. From where are these matters derived? Rabbi Abbahu said: For the verse states, "and before Eleazar the priest he shall stand" (Numbers 27:21) -- this is the king; "and all the children of Israel with him" -- this is the one anointed for war; "and the whole congregation" -- this is the Sanhedrin.
How the Urim and Tumim Answer the King and the Court
Yalkut Shimoni on Nach 76:1
ופינחס בן אלעזר היה כהן בימים ההם. ת"ר כיצד שואילים באורים ותומים השואל פניו כנגד הנשאל והנשאל פניו כלפי שכינה. השואל אומר הארדוף אחרי הגדוד הזה האשיגנו והנשאל אומר כה אמר ה' עלה והצלח. ר' יהודה אומר אינו צריך לומר לו כה אמר ה' אלא עלה והצלח. ואין שואלים לו בקול שנאמר ושאל לו, ולא מהרהר בלבו שנאמר לפני ה' אלא כדרך שאמרה חנה בתפלתה שנאמר וחנה היא מדברת על לבה ואין שואלים שני דברים כאחד ואם שאל אין מחזירין לו אלא אחד הראשון שנאמר היסגירוני בעלי קעילה גו'. והא את הוא דאמרת אין מחזירין לו אלא הראשון, אלא דוד שאל שלא כסדר והחזירו לו כסדר וחזר ושאל כסדר. ואם הוצרך דבר לשניהם מחזירין לו שניהם ואם הוצרך דבר אחד מחזירין לו אחד שנאמר וישאל דוד בה'. ואע"פ שגזרת נביא חוזרת גזרת אורים ותומים אינה חוזרת שנאמר במשפט האורים. למה נקרא שמם אורים. אורים שמאירים עינים בהלכה לכל דבריהם. תומים שמשלימים דבריהם, וא"ת בגבעת בנימן מפני מה לא השלימו את דבריהם, הם שלא בחנו אם לנצח אם שלא לנצח באחרונה שבחנו הסכימו והשלימו להם שנאמר ופינחס בן אלעזר היה כהן וגו'. כיצד עושות ר' יוחנן אומר בולטות. ר"ל אמר מצטרפות, הא לא כתבי צד"י, א"ר שמואל בר רב יצחק אברהם יצחק ויעקב כתיב שם. והא לא כתיב ט'. א"ר אחא בר יעקב שבטי ישורון כתיב שם. שנו רבותינו כהן גדול משמש בשמונה כלים ובאלו נשאלים לאורים ותומים ואינם נשאלים להדיוט אלא למלך ולבית דין ולמי שצורך הצבור בו מנא הני מילי א"ר אבהו דאמר קרא ולפני אלעזר הכהן יעמוד זה מלך, וכלל ישראל אתו זה משוח מלחמה, וכל העדה זה סנהדרין: