It mainly has to do with Klefki's ability, Prankster, along with good typing. It can't really keep up with PDon, but MRay is susceptible to both TWave and Swagger. This makes it unlikely for MRay to attack, and you can also bully it with Foul Play in order to bring it down quicker.