There are two ways of getting a Master Ball in Ruby/Sapphire/Emerald.
You can get one for free by finding it in the Team Aqua Hideout near Lilycove City. You need to be a bit far in the game to get there. The Master Ball is hiden in a room with 3 other Pokemon ball items. When you get to the room you'll find them in a squeare formation. The two on the right are lvl 30 Electrode. You can catch the or fight them. Don't bother coz there's a good chance they'll just blow up. The two on the left are much better. One is the Master Ball and the other is a Full Restore I think (it's something good but not as good as the master ball)
By winning the lottery. If you go the Lilycove Department store and talk to the woman on the left on the ground floor you can get a lotto ticket. You get prizes if the numbers on the ticket match the ID number of a Pokemon you have. So if you haven't traded any Pokemon then you have a really slim chance of getting all 6 numbers correct coz you only have one type of ID number. If you can't trade with anyone you know then you can trade with the people in the game (i think that's one of the reasons they're there) Hope I helped.