Mastering can be covered in an entirely different and vast section because it takes good listening skills and knowledge of audio. It involves techniques like equalization (EQ), compression, limiting and noise reduction. It’s also vital that you get yourself a pair of studio monitor headphones to hear all of those subtle details of a track.
To make your rap beats sound much better, then you should learn the basics of mastering, which you’ll notice a massive difference when a track is mastered to sound flawless.
Filter or EQ out unnecessary low frequencies, cut as much as you can and leave only the fundamentals of the instrument. A great way to do this is to high-pass filter hi-hats and cutting the bottom completely. If you want a specific boost outside of the fundamentals of the instrument, use an EQ for a bump with a wide Q. The point is to rebalance the sound and avoid useless summing in the low frequencies. A hi-hat is a hi-hat. Same goes for snares, though a low bump often does miracles on a snare.
A big bottom end is usually a prerequisite for a great hip hop sound. So if you have indeed used a fat bass sound, pay particular attention to compressing and EQing it so that it has plenty of energy and weight, but doesn’t overwhelm the bottom end of the whole track. You might want to use a sidechained compressor for this, or possibly a multiband compressor. Both will enable you to compress the bass differently if it strays into the lower mids at any point in a track.
If you have used samples in your tracks, perhaps beats or instrument loops, some of the work has been done for you, since these are in a sense already mixed. However in the context of your track they may need altering, especially if you have used other samples from different sources. Use EQ and compression to try to make all your samples sound like they belong in the same track. That doesn’t mean trying to make them sound the same, but try to avoid the impression that they have been culled from lots of different records, even if that is in fact the case. Using pre-recorded samples can also affect the soundstage and texture of your track, and these are things to bear in mind as you mix.