Maya is one of the most complex theory dealt with in Vedantic scriptures. Many scholars have discussed this topic for days. It is one of the theories which relates to theory of Karma (which is beautifully dealt with in Bhagwad Gita). Not many sadhus even talk about it saying one is not qualified to easily understand(probably they too don't understand a lot like Quantum Mechanics for physicists). We can discuss Maya as an inferior energy of Lord Krisna (as talked by the Dvaitas) or as a veil between our knowledge self and us (as by Advaitist) but it will be cumbersome to talk about it in detail and explaining it in present context. Let me just present the basic concept here.
Theory of Maya is combination of three idea : desha-kala-nimitta: Space, Time and Causation- and the three are reduced to Nama-Rupa. Suppose there is a wave in an ocean. The wave is only distinct from the ocean in its form and name, and this form and wave cannot have any separate existence from the wave; they exist only in the wave. The wave may subside but the same amount of water remains, even if the name and form that were on the wave vanish forever. So this Maya is what makes the difference between me and you, god and men. Its Maya which makes the Atman being caught into different beings that are distinguishable only through name and form. If you leave it alone, let name and form go, all this variety vanishes forever and you are what you really are.