You can use this ratio of ingredients, at first anyway. Play with it and use what fits your tastes.
You then add spices at a ratio known as the 8:3:1:1 rub. It works! Like this:
* 8 tablespoons light brown sugar tightly packed
* 3 tablespoons kosher salt
* 1 tablespoon chili powder
* 1/2 teaspoon ground black pepper
* 1/2 teaspoon cayenne pepper
* 1/2 teaspoon thyme (crushed)
* 1/2 teaspoon onion powder
and so on...
Regardless of the spices you choose to use, just stick to this ratio and you should be gold.
You should use dark sugars like sugar-in-the-raw, or high quality brown sugar. Kosher salt is also preferred for the best dry rub recipes.
Go forth, and become a Master BBQer! :)