I don't believe it is necessary for there to be some one to pray to in order for prayer to be useful or beneficial. Prayer can just as easily be seen as guided meditation or contemplation.