It's a funny thing, prayer. Some people do it to clear their minds; some do it because they think it will help whatever it is that troubles them; some do it out of habit; most theists do it because they believe some supreme beings can read their thoughts and make things happen in their favor.
It's a funny thing, freewill. Some people think we don't have it; theists think we have it, an ability to do whatever we want; some theists think freewill is merely an illusion and we are all predestined to live life exactly how it turns out (and many theists have never done any critical thinking to see these last two statements are at odds with each other).
It's a funny thing, god. Some people believe he exists; some believe he doesn't exist; some theists believe he has a master plan that can't be changed because their god is omniscient and has seen/laid out everything past, present and future.
Now, I have written about prayer, freewill and god's master plan before, but I have a different slant this time. Let's combine all three.
I've heard people pray for family members to do the right thing, for the surgeon to do his best or for the person in the car ahead of them to bypass the open parking spot.
While at first blush these statements may seem arbitrary and harmless, especially to a theist, but a deeper understanding of the three elements I carefully laid out at the top of this post will help you see these statements are confusing and contradictory in a theist's worldview.
If you are a theist, you believe in intercessory/petitionary prayer, meaning you think god and his heavenly compadres can hear your prayers and "answer" them. That if you ask for cancer to leave your friend's body, god can hear your request and make the decision to rid your friend's body of cancer, sending him into remission. We already see something wrong with this because if you are a theist, you believe your god is all-knowing and already has planned out every day of your life and your friend's.
But let's take it a step further: Suppose now you were the one asking your god that the surgeon does a good job on the surgery for your friend, who has cancer. You are now violating free will and god's master plan. You see, by asking god to make sure the surgeon does a good job (and expecting god to actually follow through), you are taking away the freewill of the doctor to falter or do something differently. Plus, you are asking god to change his plan (for if your friend was destined to die on that table, then god would be changing his master plan just for you, and if he was destined to live then god wouldn't listen to you because it was in his plan anyway). The only way god listens to your prayers is if he is willing to change his plan, which, if you're a theist, you believe can't happen. The second you believe your prayers have been answered is the exact moment you contradict your core beliefs in god's master plan.
The same holds true for the trivial parking spot. If you pray, "Please, God, don't let her take that parking space!" You are admitting you don't believe in free will and your prayers can make god change his plan just for you. Quite a bit of arrogance, no? Because if god knew this person was going to take this spot, he would have to insert a thought into her head to make her drive past the opening. This violates the woman's freewill.
This is one of many logical problems with theism and what happens when you write a bunch of supernatural laws and gibberish into a holy text. You find out later it doesn't make sense when you hold it up to scrutiny. You cannot believe people have freewill, god has a plan and prayers get answered. You can believe in one of these, but you can't believe in any two because they ultimately contradict one another.