The Sun, the Scare, the Secret Lair! (Japanese: 課外授業はヒドイデ！？The Extracurricular Lesson is Hidoide!?) is the 12th episode of the Sun & Moon series, and the 951st episode of the Pokémon anime. It first aired in Japan on January 26, 2017, in the United Kingdom on June 2, 2017, and in the United States on June 3, 2017.
Team Rocket has been living in the lap of lazy luxury thanks to Bewear...but a wake-up call from the Boss gets them back on track, and they head to the beach in search of Pokémon.
On a field trip to the same beach, Ash runs into Team Rocket, and a wild Mareanie who has developed a fondness for James joins the battle. It pummels Pikachu and poisons Rowlet, and Team Rocket is on the brink of celebrating a long-awaited victory against the Twerp—until Bewear barges in and carries them off! Undeterred, the villains declare Bewear’s lair as their new secret base and settle in to a berry feast!
Team Rocket is relaxing inside Bewear's den, feeding on Berries whilst Bewear stands guard outside when a call through from the Team Rocket HQ. It is Matori calling wanting to know why they haven't received any reports since they arrived in Alola. Jessie responds angrily only for Giovanni to get involved. They report that they have captured a Mimikyu and attempt to pass Bewear off as a capture as well. Giovanni signs off convinced as Matori requests more regular reports in future, much to Jessie's annoyance. The group contemplates catching Bewear but decide against attempting it due to Bewear's strength, and ultimately decide to go out and catch a new Pokémon.
Ash and his classmates are down on the beach along with Professor Kukui and their Pokémon. Lana takes off her clothes leaving her swimsuit on and goes for a swim alongside Popplio as Ash and Pikachu splash about in the shallows. They invite Rotom and Rowlet to join them but Rotom declines fearing the water will interfere with its electrical circuits, despite Kukui reassuring it that it was built to be waterproof. Rotom ends up squirted by Sophocles and his invention, a Clawitzer water gun, to prove that Rotom is waterproof. Sophocles and Togedemaru begin splashing Ash and Pikachu, turning it into a friendly match. Mallow has Lillie join her in the water as they have a splash around with Lana, Popplio and Bounsweet, and they quickly turn it into a competition between the girls and boys as Kiawe and Rockruff go to join in.
Nearby Team Rocket are out fishing for new Pokémon but Jessie gets bored of waiting. Jessie leaves it to Meowth and James and has a drink and malasada, only to have the malasada stolen by a Wingull. James suggests catching it, but Jessie is furious and decides not to as Wingull takes the malasada to feed for its fowl. Spotting a Cloyster nearby, Meowth suggests they catch it. Jessie throws a Poké Ball without battling, only for Cloyster to swallow the ball. They try to get the ball back only for a wave to come up, soaking them and allowing Cloyster to spit the ball out and swim away.
Ash and Kiawe have a race to a nearby rock as Rowlet flies overhead which Kiawe wins and they spot three Corsola also on the rock. Ash decides to have a go at catching one and asks Rowlet to assist, but the Corsola quickly swim off the rock. Realizing what's coming, Kiawe warns Ash to get off the rock as a group of Mareanie arrive and begin to swarm up the rock. Ash heeds the warning and swims away. Back with the others, Professor Kukui tells them it was a close call as Mareanie are extremely dangerous when traveling in groups. Rotom provides Ash with some information about them. Ash wants to try and battle them while Rowlet expresses its reluctance. Mallow points out that Mareanie are a common sight along the coastline and tells Ash he may encounter the Mareanie again, as Lillie invites them over for a break.
A Carvanha swims near Team Rocket and James attempts to catch it with his bazooka-powered net, only for it to bite through the net. Meowth notices Mimikyu is missing and wonders where it is when he spots its disguise in the water and soon spots its body nearby which scares him. Jessie and James soon find him in the water and his soul comes back. He warns them about Mimikyu but by now Mimikyu is back in its disguise, but now with its drawn-on face running from being in the water, appearing even more horrifying than ever. Wobbuffet is fishing, surrounded by several Corsola, but fishes up nothing but a sandal. Trying a new strategy with ambush, James puts on some scuba gear with a Corsola-shaped helmet but Meowth and Jessie decline to go with him as he enters the water. After swimming some distance, James bobs about on the surface hoping that Carvanha will come back but spots several Alomomola swimming about. As he goes to lure them in, a Mareanie attaches itself to his helmet and attacks him, cracking the glass as he struggles underwater.
Back on dry land, James has pulled the helmet with Mareanie still attached as Meowth wonders what has happened. After explaining, Team Rocket looks at Mareanie while James consults his guidebook, discovering that it is very poisonous. To James's horror, Jessie suggests catching it as they could use a Poison type which causes Mareanie to attach itself to James's head and leaves him poisoned; his face turns purple with yellow sclerae, causing James to resemble a Mareanie himself, which the wild Mareanie becomes enamored by, and starts to chase James around.
Professor Kukui decides it is time for Pokémon observation where everyone must find and observe a target Pokémon. Whilst Lana goes underwater and Kiawe up a tree, Sophocles opts to study a Staryu and Shellder, Lillie observes a Mankey and Primeape, and Mallow observes two Pichu. James is still trying to escape from Mareanie, wondering why it is following him. Translating, Meowth explains that Mareanie is in love with James's appearance, but Jessie isn't impressed. Ash is still looking for a Pokémon to observe when he comes across Team Rocket. Taking the opportunity to capture Pikachu, Jessie orders Mimikyu to use Shadow Ball which Pikachu intercepts with Iron Tail. Meowth and Wobbuffet get involved but are attacked by Thunderbolt when Mareanie gets involved and attacks with Spike Cannon. Pikachu dodges and James realises Mareanie is battling for them. Ash and Pikachu get distracted allowing Mimikyu to attack with Shadow Claw. Rowlet attempts to assist with Leafage but is hit by Mareanie's Sludge Bomb leaving Rowlet poisoned. Mareanie's Sludge Bomb leaves a cloud of dust allowing Mimikyu to attack again leaving Pikachu and Rowlet defeated and giving Team Rocket victory but as they celebrate, Bewear jumps out of the water and carries them back to its den. With Team Rocket gone, Ash tends to his Pokémon.
Returning to the others, Professor Kukui gives Ash an Antidote to heal Rowlet's poison and Rowlet soon recovers. Ash thanks the others for their help and Mallow suggests a game of Volleyball which Ash agrees to and Popplio makes a balloon for the game. Rowlet gets swallowed up when the balloon splits and merges again but Togedemaru soon pops the balloon. Popplio creates another as they continue their game.
Bewear deposits Team Rocket back at its den along with Mareanie and gives them honey and some berries to eat. They decide to make the den their secret base. James thanks Mareanie for its help and invites it to join his team. Mareanie happily agrees to this, and James catches it in a Poké Ball. Once let out, it affectionately attacks James, poisoning him once more.