The Talmud asks rhetorically, "How is God different from a human ruler?" and answers that if you bring a gift to a human ruler, he may or may not deign to receive you. But if you give money to a poor person you will see the face of the Shechinah, the divine presence, as it says in Psalms 17:19, "I ,in righteousness shall see Your face." An act of righteousness is the best possible preparation for prayer. The face of God may be revealed, so to speak, when you honour the face of a needy person. Based on this passage, there is a strong custom to give tzedakah (charity) before morning prayers (Shulchan Aruch).
Beggars know this piece of Gemara very well in many synagogues; particularly in Israel, there is a procession of them throughout the morning service. This can get pretty distracting and leading rabbis have discouraged the practice. Some shuls follow the custom of the Arizal, the great 16th-century Kabbalist, Rabbi Isaac Luria; people get up and put money in a tzedakah box during the Pesukei D'Zimra section on reaching the words atah moshel b'kol, "You rule over everything" - at the moment when we acknowledge that all possessions are from God, we go and give a little of ours away.