This article needs additional citations for verification. (May 2014)
He was born at Érsekújvár ( Nové Zámky) on 11 September 1723 in a family which came from the Puster Valley in the County of Tyrol.  He studied in Pressburg (present day Bratislava), entered the Society of Jesus in 1745, spent two years in the Jesuit college (St. Ann's) in the Austrian imperial capital Vienna and completed his higher studies at Nagyszombat ( Trnava).
He taught at Nagyvárad ( Oradea), Trencsén ( Trenčín), Nagyszombat and Pressburg. In 1754 he was ordained priest and continued teaching, now in Rozsnyó ( Rožňava) and in the Theresianum at Vienna, where he was professor of political science, and at the same time tutor to the princesses of Salm. He was professor in Győr (1758), Nagyszombat (1759) and Buda (1760), where he lectured, among other subjects, on moral theology.
At the suppression of the Jesuits in 1773, he went to the Archdiocese of Gran and Empress Maria Theresa appointed him imperial historiographer, with a yearly income of 400 florins. When the University of Nagyszombat was transferred to Buda in 1777, Pray was given charge of the library; he resigned this position in 1780, but resumed it in 1784. During this year he surrendered his manuscripts and collection of documents to the university library for a life annuity of 400 florins. He became canon in Nagyvárad (Oradea) in 1790, and was sent by the chapter as its representative to the Hungarian Diet. Later he became Abbot of Tormowa[ clarification needed]. He died in Pest on 23 September 1801.
His literary activity embraced the history of Hungary, especially the early centuries, the history of the Catholic Church in Hungary, and editing the sources of Hungarian history.
He was the first to draw attention to the oldest coherent text in the Hungarian language, Funeral Sermon and Prayer (Latin title "Oratio funebris", meaning 'funeral oration'), dating probably from 1199, in a manuscript which was called after him the Pray Codex.
Among his works may be mentioned