Words borrowed directly from Ancient Greek usually use
η: теология, термометр, библиотека.
Works borrowed through Byzantine Greek (translated from Byzantine sources) use
и: Фёдор, Фермопилы, Афины, Фивы.
The same applies to the Hebrew loanwords and transliteration of Hebrew names: biblical names would read as Варавва (Barabbas), Вифлеем (Bethlehem), Эсфирь (Esther), Валаам (Balaam), while names transliterated at later times use modern reading: Бар-Кохба (Bar-Kokhba).
Some words changed their spelling from Byzantine to Ancient Greek with time (вивлиофика -> библиотека, апофика -> аптека etc.). The spelling of such words was not stable at the time, this is why Mitya spells it the Byzantine way while the modern spelling is the Ancient Greek way.
In the modern language, new words are borrowed using Ancient Greek reading and the reading of existing loanwords is stabilized, so I'm not aware of words in the modern language which are read both ways (one of the readings would be considered obsolete).
Some common names of the same origin, spelt the same in other languages, are spelt differently in Russian: for instance, the name of the city of Beth Shemesh, Israel is spelt
Беф-Шемеш in biblical context and
Бейт-Шемеш in the modern context.