5/10/2010 11:00 AM PDT

Joel Osteen -- Dr. Murray Invited Himself

According to sources connected with Dr. Murray ... TMZ first reported Osteen personally invited Dr. Murray and even gave him a secret code to enter Osteen's Houston church.

But Osteen's rep tells TMZ they were approached by Dr. Murray's people who said the doctor was in need of prayer and Osteen agreed to pray with him.

One of Osteen's reps griped to TMZ, "It seems like this was more of a PR move than seeking actual prayer."

UPDATE: A rep for Murray says the good doctor attended the service "at his own free will." Murray, in a statement to TMZ, said, "I was grateful for the blessings, prayer and words of encouragement I felt during services. It was a spiritual moment for me, personally ... I sincerely express my thanks and gratitude and will continue to remain strong in my faith."