Mainly Zoroastrianism and the Cathars, but as with anything George does it is not a one-to-one comparison and he draws inspiration from numerous sources.
According to George R. R. Martin, this religion's dualistic aspects of a good and an evil god are inspired by Zoroastrianism, along with the Cathars of Medieval Europe.
In this interview (at about 47:00 GRRM) talks about his inspirations for religion in his works. I have taken the relevant parts and transcribed them below.
[Host] Okay, so this next question is, 'In your books there are several religious systems such as The Seven, The Drowned God, The Faceless Men, The Old Gods, etc. How do you come up with such a detailed yet entirely distinct doctrines? Are there any that aren't detailed in the books?
[GRRM] Well, yes. To start with the last part first, yes. There are many religions that are not detailed. You can see some of them in Arya's Bravos chapters where she visits, passes through the Island of the Gods and I throw in references to 17 different obscure religions that I'm probably never going to reveal in much detail.
...
The major religions that actually play a significant role in the story are somewhat based on real religions, or real religious systems. Although,I don't believe in just doing a one to one transformation where I'm going to take like Islam and file off the serial numbers and call it Mislam or something and pretend it's the same. I take certain tenants of the religions, but I maybe take part of this and part of that and I meld them together and I think about it and I add a few imaginative elements.
...
And then you have the Red God, The Lord of Light, from across the sea which has a certain Zoroastrianism elements to it with the fire worship and so forth and the duality. And also a lot from the Albigensian Crusade, the Cathars, who were exterminated by the Catholics and the Great Albigensian Crusade. But they had a fundamental belief, a dualist religion, that there were two gods, a good god and an evil god, and the world that we live in was created by the evil god...