The Mountain Path
Travel up the path along the outside of Mt. Pyre. You need to reach the top of the mountain because that will begin a gauntlet event where you fight a series of Team Aqua grunts.
The Gauntlet Challenge
Fight each of the Team Aqua grunts in turn. They will each use one of four Pokemon: Zubat, Poocyena, Carvarnha, and Wailmer. Choose your Pokemon accordingly to make the battles easier. After defeating them, you will meet an old couple, who will tell you that you need to find Team Magma. They will also give you a Magma Emblem, which will let you into the Magma Hideout.
Finding the Magma Hideout
Travel to Lilycove City and exit to the east. You can accomplish this by going to the top-right part of the city and traveling down the ledges. Continue east once you have reached the bottom. Once you have found the Team Aqua members who block your path, surf north until you find an entrance. Enter it and talk to the Aqua members by the steps, who will tell you that the Team Magma members have fled to Mt. Chimney.
Finding the Magma Hideout (Part 2)
Leave Lilycove City and use your Fly skill to get to Lavaridge Town. Travel to Mt. Chimney and use the cable car to go up. When you reach the top, enter Jagged Pass. After entering Jagged Pass, move down into the forested area and the ground will shake in reaction to the Magma Emblem you earned on Mt. Pyre. A secret entrance will open and you will be able to enter the Magma Hideout.