The Devas (About Jhāna)
Deva Sutta  (AN 9:39)

“Once, monks, a battle between the devas & asuras was in full swing. And in that battle, the asuras won and the devas lost. Having lost, the devas simply fled while the asuras, heading north, attacked them. Then the thought occurred to the devas, ‘The asuras are still attacking. Why don’t we do battle a second time?’

“So the devas did battle with the asuras a second time. And a second time, the asuras won and the devas lost. Having lost, the devas simply fled while the asuras, heading north, attacked them. Then the thought occurred to the devas, ‘The asuras are still attacking. Why don’t we do battle a third time?’

“So the devas did battle with the asuras a third time. And a third time, the asuras won and the devas lost. Having lost, the devas, afraid, entered the deva capital. Having gone to their capital, the devas thought, ‘Having come to this shelter for the fearful, we will now keep here to ourselves, having nothing to do with the asuras.’ And the asuras also thought, ‘Having gone to this shelter for the fearful, the devas will now keep here to themselves, having nothing to do with us.’

“Once, monks, a battle between the devas & asuras was in full swing. And in that battle, the devas won and the asuras lost. Having lost, the asuras simply fled while the devas, heading south, attacked them. Then the thought occurred to the asura, ‘The devas are still attacking. Why don’t we do battle a second time?’

“So the asuras did battle with the devas a second time. And a second time, the devas won and the asuras lost. Having lost, the asuras simply fled while the devas, heading south, attacked them. Then the thought occurred to the asuras, ‘The devas are still attacking. Why don’t we do battle a third time?’

“So the asuras did battle with the devas a third time. And a third time, the devas won and the asuras lost. Having lost, the asuras, afraid, entered the asura capital. Having gone to their capital, the asuras thought, ‘Having come to this shelter for the fearful, we will now keep here to ourselves, having nothing to do with the devas.’ And the devas also thought, ‘Having gone to this shelter for the fearful, the asuras will now keep here to themselves, having nothing to do with us.’

“In the same way, monks, on whatever occasion a monk—secluded from sensuality, secluded from unskillful qualities—enters the first jhāna: rapture & pleasure born of seclusion, accompanied by directed thought & evaluation, on that occasion the thought occurs to him, ‘Having come to this shelter for the fearful, I will now keep here to myself, having nothing to do with Māra.’ And the thought occurs to Māra, the Evil One, ‘Having gone to this shelter for the fearful, the monk will now keep here to himself, having nothing to do with me.’

[Similarly with the second, third, & fourth jhānas.]

“On whatever occasion a monk, with the complete transcending of perceptions of (physical) form, with the disappearance of perceptions of resistance, and not attending to perceptions of multiplicity, (perceiving,) ‘Infinite space,’ enters the dimension of the infinitude of space: He is said to be a monk who has put Māra in the dark.1 Having bound Māra’s eyes and leaving no trace, he has become invisible to the Evil One.2

[Similarly with the dimensions of the infinitude of consciousness, nothingness, and neither perception nor non-perception.]

“On whatever occasion, with the complete transcending of the dimension of neither perception nor non-perception, he enters & remains in the cessation of perception & feeling; and as he sees (that) with discernment, effluents are completely ended: He is said to be a monk who has put Māra in the dark. Having bound Māra’s eyes and leaving no trace, he has become invisible to the Evil One, having crossed over attachment in the cosmos.”3

Notes

1. The text here has antamakāsi—“has put an end to”—which does not fit the context as well as the reading, andhamakāsi—“has put in the dark”—found in the parallel passage in MN 25, so I have followed the latter reading here.

2. The interpretation of this image here differs from that in MN 25 and MN 26, both of which state that the monk puts Māra in the dark upon entering the first jhāna. In either case—putting Māra in the dark beginning with the first jhāna, or only beginning with the dimension of the infinitude of space—the “dark” is temporary, lasting only as long as one is in that attainment.

3. This is the only one of these attainments that inherently contains the discernment that takes one, once and for all, beyond attachment in the cosmos.

See also: MN 4; MN 26; SN 35:115