N4
ようにいのる
Pray that/for, Hope that/for, Keep fingers crossed that
明日雪が降って学校が休みになるように祈る。
I hope that it snows tomorrow and school gets canceled.
Explanation
「〜ように祈る」 means 'pray that …' or 'hope that …'. You sincerely wish for something good to happen, or something bad not to: 「早く良くなるように祈っています」 (I'm praying you get well soon). It is common in blessings at the end of letters and e-mails: 「皆様のご健勝をお祈り申し上げます」. In speech people often end with just 「〜ように!」 as a wish: 「試験に合格しますように!」 (May I pass the exam!).
Mixed up with
Before it you usually find a non-volitional verb or a potential form: 「病気が治るように」, 「合格できるように」. You pray because the result is not up to your will alone.
Standing alone at the end, 「〜ますように」 or 「〜ように」 is like 'may …'. It can take 「ます」: 「幸せになれますように」.
With elders or in business letters use the humble 「お祈り申し上げます」 or 「お祈りいたします」.