。
She used to pray before going to bed.
Literal
She [topic-は] sleeping before [to-に] prayed used-to.
~たものだ expresses nostalgic recollection of past habits — 'used to do X.' The もの here isn't 'thing' literally but a grammatical device marking habitual past action with a wistful or reflective tone. 祈る (いのる, 'to pray') suggests a nightly ritual, possibly from childhood.