After the battle with Tartaros is over, Gray lives with Juvia near Amefurashi Village, where the two train, eat, and work together, but do not sleep together, as Gray refuses to do so.  Six months after, as Natsu travels around trying to revive Fairy Tail, Gray sits with the members of the cult Avatar, revealing himself as having joined their ranks, his body still afflicted with the black markings.  Later, some of the cultists discuss the presence of a Magic Council spy in their midst and accuse Gray as he doesn’t have a reason to worship Zeref because his past is enough for him to hate the Black Mage. N.D., and that he has given up his guild and is willing to use Avatar to accomplish this. He walks away from the group after this ominous declaration. 
However, six months after Fairy Tail’s breakup, strange markings appear on half of Gray’s body and he leaves Juvia in the village all alone, not making any contact afterwards
Later, Gray goes and sits by his lonesome, only to hear Natsu’s voice inside Avatar’s headquarters.  Gray then follows the voice to Gomon’s training chamber, where he sees him, D-6 and Abel defeated by Natsu; Gray tells Gomon that Natsu isn’t someone they could ever beat and menacingly says that he’ll take care of him.  Immediately, Gray and Natsu attack each other, paying no attention to Lucy asking them to stop. They continue delivering and blocking the attacks supported by their respective Magic, with Gray explaining that he’s doing all of this because that’s what he wants. Natsu attempts to persuade Gray, mentioning both Juvia, as well as the revival of Fairy Tail, however, Gray wants nothing with that anymore, asking them to stop playing at friends. In spite of an initial surprise, Gray recognizes this as Mary’s work, watching as the rest of his former friends get captured by Avatar afterwards. He notes that Natsu is just sticking his nose into other people’s business again and when Natsu tries to continue the argument, mentioning that Gray has been possessed by Demons, the Ice Mage reveals that he’s even gotten rid of the Fairy Tail mark, further proof of his change. 
This angers Lucy, however, before she can do much, she is brought to her knees, with her stomach in pain
Afterwards, Gray arrives at the captured trio’s cell just in time to freeze Gomon before he can kill Lucy, subsequently shattering the prisoners’ Magic Sealing Handcuffs by freezing them too. Ruffling his hair back to its former style, he calls Erza and announces himself as a «Code Blue,» then hands the phone to Natsu.  Gray reveals that he joined Avatar because of his undercover mission, claiming that he wouldn’t hang out with such guys otherwise. Together with Natsu, Lucy and Happy, Gray leaves the Avatar HQ and while on move, he explains about his mark, as well as his mission. Natsu questions the reason payday loans in New York locations behind not informing Juvia just to learn that it was to increase the success of the mission. Gray also explains that they were unable to simply defeat Avatar, as they are just a small part of a bigger organization which doesn’t get together till the day of Purification Plan. Gray then turns to Lucy, apologizing for his previous behavior, and smiles as he says that he didn’t even mind the slap as Lucy was wearing a maid outfit, much to her embarrassment. Together, the group arrives at the entrance of Malba City just in time to stop the attacking cultists. Gray smiles when Natsu points out his improved ability and with the rest of his friends, he gets ready to face the main body of the cultists.