Things You'll Need
Instructions
Acquire a Sun Ribbon. You can get this item at Kecleon Shops. The inventory at these shops is randomized every day, and no shop has the same inventory on any given day, so try different shops on different days until you find one.
Complete the quest from the Scyther in Area 10F on Blizzard Island. He wants you to take an item from Bronzor, a strong Pokemon. This is a six-star quest, so you can only take it if you are above Gold Rank. The reward for this quest is a Sun Ribbon.
Complete the quest from the Ghastly in Area B2F of the Beach Cave. This is a D-rank quest and is available early in the game. You must explore the cave with the Ghastly. He rewards you with 150 Poke and a random item that is sometimes a Sun Ribbon.
Give Riolu the Sub Ribbon and raise his IQ until it is above one star. To raise your Riolu's IQ, feed him Orange Gummis. You can find Orange Gummis throughout the Marine Resort, or you can complete the Hoothoot's quest in Area B8F of the Waterfall Cave. Hoothoot wants you to take an item from the Slugma, and will reward you with an Orange Gummi.
Take Riolu to the Luminous Spring in the Mystifying Forest, where you evolved the other Pokemon in your party. When prompted, say that you want to evolve a Pokemon, and offer Riolu to be evolved. Watch the ensuing scene, then leave with your newly evolved Lucario.