This is the 8252nd most frequent Russian word.
марией
"Марией" is the instrumental case of the name "Мария" (Maria), meaning "by/with Maria."
In this sentence, 'Марией' is in the instrumental case, indicating the means or companionship along with the preposition 'с'. It shows association with Maria.
Я дружу с Марией.
I am friends with Maria.
Here, 'Марией' is used in the instrumental case to indicate the agent performing the action of writing, showing who wrote the book.
Книга написана Марией.
The book was written by Maria.
In this case, 'Марией' again appears in the instrumental case, showing with whom the conversation took place.