Being the other woman.. Need urgent advice

I'm in need of serious advice because I feel awful.. So my ex, one who goes back and forth between us dating and loving each other to dating other people and coming back for 2 years, and I just had sex.. We were steady for a year and then we've been going back and forth from one another.(background info) he was the first guy I ever fell in love with and truly fell for him. He has been dating this girl Mary, the "love of his life" and best friend for months now. He recently started talking to me and I told him I was happy for him, which I truly was, for being with Mary. I knew he loved her. But everytime he'd talk to me, he acted like she wasn't involved. Honestly, I thought they had broken up. They stopped eating lunch together, I didn't see them walking with each other , he never wanted to speak of her existence. Anyway, we just had sex and I'm not going to lie there are feelings still there for my ex. There are.. But not as intense so of course, I'm not going to turn down sex with him. We had waited so many years and it finally happened.. But then I wanted to make sure if he and Mary were over so I asked him.. I should've done it before hand but I honestly thought they had broken up. I asked him and he said, "yes..... I'm still with Mary." It was quiet and I asked him ," does she make you happy?" He responded ," yes she's my best friend; it's just we never see each other , we barely talk, it's like we don't exist." I don't know what to do.. I told him I wouldn't tell her because it's not my place. Help please..