I don't know if there's really a good way to stop it completely, especially if your cat really likes to kick the litter around like my cat. But I have found some ways to minimize it so that it's not really an issue for me.
I have the Tidy Cat's Breeze system, which has been a massive improvement over traditional litter boxes.
The biggest improvement I think comes from the use of pellets instead of the powdery clay of traditional pellets. While still susceptible to being kicked out, it's been less than the clay litter because there isn't dust getting kicked into the air, it's easier to clean with just a broom, and doesn't stick to their fur and get tracked further than the litter box. As an added bonus, it also doesn't smell like cat litter the way the clay stuff does, and since it doesn't have dust that would get in my cat's hair he also doesn't smell like the litter.
I imagine that the same would apply if you simply used the pellets in a normal litter box. I've seen pellet litter before in types like "Yesterday's News", which is compressed newspaper, and some types of compressed wood/walnut shells.
In the past, when using clay litter, I had a litter box that had a sort of "lid" that adds a curved lip to the pan.
It never solved the problem entirely for me, my one cat still managed to kick out some litter. But it was a significant amount less than it was before. The lip caught the litter that he kicked around, and anything else was such a small amount that it stayed just by the litter box rather than getting tracked outside the room.