Maya is nothing but the egotism of the embodied Atman. This egotism has covered everything like a veil. All troubles come to an end when the ego dies.
This maya, that is to say, the ego, is like a cloud. The sun cannot be seen on account of a thin patch of cloud; when that disappears one sees the sun. If by grace of the guru one’s ego vanishes, then one sees God.