The following excerpt is taken from Albert Einstein: The Human Side, Selected and Edited by Helen Dukas and Banesh Hoffman, Princeton University Press, 1979.
A child in the sixth grade in a Sunday School in New York City, with the encouragement of her teacher, wrote to Einstein in Princeton on 19 January I936 asking him whether scientists pray, and if so what they pray for. Einstein replied as follows on 24 January 1936:
I have tried to respond to your question as simply as I could. Here is my answer.
Scientific research is based on the idea that everything that takes place is determined by laws of nature, and therefore this holds for the actions of people. For this reason, a research scientist will hardly be inclined to believe that events could be influenced by a prayer, i.e. by a wish addressed to a supernatural Being.
However, it must be admitted that our actual knowledge of these laws is only imperfect and fragmentary, so that, actually, the belief in the existence of basic all-embracing laws in Nature also rests on a sort of faith. All the same this faith has been largely justified so far by the success of scientific research.
But, on the other hand, every one who is seriously involved in the pursuit of science becomes convinced that a spirit is manifest in the laws of the Universe -- a spirit vastly superior to that of man, and one in the face of which we with our modest powers must feel humble. In this way the pursuit of science leads to a religious feeling of a special sort, which is indeed quite different from the religiosity of someone more naive.
It is worth mentioning that this letter was written a decade after the advent of Heisenberg's prin ciple of indeterminacy and the probabilistic interpretation of quantum mechanics with its denial of strict determinism.