Rambam writes (avodah zarah 11:12):
הַלּוֹחֵשׁ עַל הַמַּכָּה וְקוֹרֵא פָּסוּק מִן הַתּוֹרָה, וְכֵן הַקּוֹרֵא עַל הַתִּינוֹק שֶׁלֹּא יִבָּעֵת, הַמַּנִּיחַ סֵפֶר תּוֹרָה אוֹ תְּפִלִּין עַל הַקָּטָן בִּשְׁבִיל שֶׁיִּישַׁן - לֹא דַּי לָהֶם שֶׁהֵם בִּכְלַל חַבָּרִים וּמְנַחֲשִׁים, אֶלָּא שֶׁהֵם בִּכְלַל הַכּוֹפְרִים בַּתּוֹרָה, שֶׁהֵן עוֹשִׂין דִּבְרֵי תּוֹרָה רִפְאוּת גּוּף, וְאֵינָן אֶלָּא רִפְאוּת נְפָשׁוֹת, שֶׁנֶּאֱמַר: "וְיִהְיוּ חַיִּים לְנַפְשֶׁךָ" (משלי ג,כב). אֲבָל הַבָּרִיא שֶׁקָּרָא פְּסוּקִין אוֹ מִזְמוֹר מִתִּלִּים כְּדֵי שֶׁתָּגֵן עָלָיו זְכוּת קְרִיאָתָן וְיִנָּצֵל מִצָּרוֹת וּנְזָקִים - הֲרֵי זֶה מֻתָּר.
A person who whispers an incantation over a wound and then recites a verse from the Torah, who recites a verse over a child so that he will not become scared, or who places a Torah scroll or tefillin over a baby so that it will sleep, is considered to be a soothsayer or one who cast spells. Furthermore, such people are included among those who deny the Torah, because they relate to the words of Torah as if they are cures for the body, when, in fact, they are cures for the soul, as [Proverbs 3:22] states: "And they shall be life for your soul." It is, however, permitted for a healthy person to read verses [from the Bible] or chapters from Psalms so that the merit of reading them will protect him and save him from difficulties and injury.
Not all of tehilim are prayers.
Typically tehilim is recited to cure an undesirable situation rather than head one off.
I would imagine (altho not explicit) that if "the merit of their reading" is being invoked vs them being used magically then it may be used even in the first few cases mentioned by Rambam, with the converse true as well (altho why motivation isn't posited as the diffentiating halachic factor isn't clear).
Folks nowadays seem to just read it without too much comprehension ostensibly using it as a segulah and presumably running afoul of this halacha and severe censure.
Anyone know what's up with that?