From Discourses of the Ancient Nuns (BL 143), translated from the Pali by Bhikkhu Bodhi (Kandy: Buddhist Publication Society, 1997).
Then Mara the Evil One, desiring to arouse fear, trepidation, and terror in the bhikkhuni Soma, desiring to make her fall away from concentration, approached her and addressed her in verse:
"That state so hard to achieve
Which is to be attained by the seers,
Can't be attained by a woman
With her two-fingered wisdom."
Then it occurred to the bhikkhuni Soma: "Now who is this that recited the verse -- a human being or a non-human being?" Then it occurred to her: "This is Mara the Evil One, who has recited the verse desiring to arouse fear, trepidation, and terror in me, desiring to make me fall away from concentration."
Then the bhikkhuni Soma, having understood, "This is Mara the Evil One," replied to him in verses:
"What does womanhood matter at all
When the mind is concentrated well,
When knowledge flows on steadily
As one sees correctly into Dhamma.One to whom it might occur,
'I'm a woman' or 'I'm a man'
Or 'I'm anything at all' --
Is fit for Mara to address."
Then Mara the Evil One, realizing, "The bhikkhuni Soma knows me," sad and disappointed, disappeared right there.