1) Whenever the Torah is taken out to be read, the Aramaic prayer of Brich Shmei [בריך שמיה] is recited as it is removed from the Aron Kodesh.
2) There are different opinions when one should recite the prayer:
A- According to Rav Moshe Feinstein zt”l (Igros Moshe 4:70) and ybc”l Rav Chaim Kanievsky shlit”a (Halichos Chaim page 56) one should remove the Torah and then recite Brich Shmei. [Rav Moshe does point out that one should not rebuke those that act not according to this view.]
B- The Minchas Elazar of Munkatch (Darchei Chaim V’Shalom 196) would recite the entire Brich Shmei and only then remove the Sefer Torah. This is also the custom of Sefardim (see V’Zarach Hashemesh page 9).
C- According to Harav Shlomo Zalman Auerbach zt”l (Halichos Shlomo page 144) held that one may recite it either before or after the Torah is removed. Either way is fine.
D- Rav Sarya Dblitzky shlit”a (V’Zarach Hashemesh page 9) writes that in his shul the custom is to begin reciting it with the Torah still in the Aron and to take the Torah out during the recitation of Brich Shmei.
3) In either event, one may continue reciting Brich Shmei while the Torah is being carried until the Torah is opened and ready to be read. (M.B. 134:13)