I kind of want to agree with the people that say Shrine beats Rayquaza, but I believe Rayquaza eventually adapted to Shrine decks a little after some time since it's initial release. They had a Vikavolt, so they simply put in CES Dhelmise and Shining Lugia to not only have attackers that effectively dealt with many pokemon that had synergy with Shrine as well as baby pokemon given the opportunity, but just have prize one attackers in general to add a bit of defense prize-wise to Rayquaza. The following example is a singular online game I played with the Rayquaza list from Philadelphia, but I think it says something nonetheless. I beat a Shrine deck utilizing Hoopa as the main attacker with VikaRay. I kept most copies of my Rayquazas, if not all of them, in hand and just constantly used the Dhelmise(s) to hit 130 after 130 on their Hoopas, even if it meant switching and wasting 3 energy on a Dhelmise just so I can keep streaming big enough damage, and I'm sure people have done the same thing in other games / matches with Shining Lugia, as he hits Hoopa for 120 without discarding anything and can potentially OHKO FLI Buzzwole if it uses the second attack. These prize one Pokemon were that good to be in the list.
As for counters to Ray, I agree with most of what people has said above. Dedenne seems like a valid choice, but I feel like it's usage fits best if you were adding Promo Koko in decks such as Zoroark-GX / Golisopod-GX in the first place. It works, as seen in some lists in tournaments, I just feel you'd have more of a reason to use Tapu Koko than just a Dedenne trigger. ULP Tapu Lele with Choice Band will be a nice choice if you can manage to splash it in, but that should be easy if you already play access to that energy, like using Rainbow Energy in a deck like Zoroark-GX / Banette-GX or maybe even Buzzwole / Shrine. If you wanted to counter Rayquaza's setup specifically, taking out the Grubbins (esspecially when they only have one out) can be important, as Vikavolt is very key in how the deck functions. It would be kind of a pain if they had 2 Grubbins out before then, but at least they can't set up another Vikavolt which will, for sure, put them in a major advantage to say the least. Using a Judge or SLG Marshadow to shuffle a big hand drawn from Rayquaza's GX attack (which usually guarantees the turn 2 Vikavolt) should leave a dent in their setup.
If you wanted to be spicy and if you were playing Quagsire, have 5 water energies on the board, bring out Palkia-GX, Guzma up the Vikavolt, and use the GX attack to not only take out their main energy source, but undo allll the work by shuffling every energy that was on their board back into their deck. I personally never pulled it off, but since that Lapras / Quagsire deck that took 18th place in Memphis had a dragon-type Palkia in the deck, that had to have happened at least a couple times against opposing Rayquazas it fought.