Rubs come in two varieties, wet rubs and dry rubs. A dry rub is made of herbs and spices and can be either sprinkled over meat or actually rubbed in. A wet rub contains a liquid ingredient, usually oil and is coated over the surface of the meat. Beyond this, practically anything goes. What you want to use for your rub is really a matter of personal taste. You want a good rub to add flavor and color but you don't want it to overpower the flavor of the meats you are rubbing.
Having said this, what else is there to say? Well a couple of things. Most dry rubs contain such things as paprika, chili powder, granulated garlic, cayenne, etc. To get these dry ingredients to stay on requires the natural moisture of the meat. You want to enhance the flavor of the meat without overpowering it. Therefore I wouldn't recommend rolling it in a pound of cayenne. Mixing strong spices with mild, complimentary ones will help you get an even distribution. If you're going for a hot spice combination, mix mild chili powder with cayenne and paprika. It will give the meat a good color and add the level of heat you want without making the meat too hot to eat.
Wet rubs can suffer from the same problems so be careful here too. The advantage of a wet rub (or paste) is that it sticks to the meat better. This is particularly important if you are cooking poultry with the skin on or some other smooth surfaced meats or meats that tend to be naturally dry. The other advantage of a wet rub is that it can help keep meat from drying out. This is especially true when using an oil based rub. The oil acts as a moisture barrier, keeping the natural juices inside the meat. Oils in rubs can also keep meats from sticking to the grill. Remember that a wet rub should have the consistence of a paste, thick.
Rubs can be as complex or as simple as you want to make them. What really makes a rub a rub is how it is applied. I suppose that you could say sprinkling salt and pepper over a steak was like adding a rub, but this really isn't what we mean when we take about rubs, particularly a traditional barbecue rub. A rub should coat the surface of the meat. You should work a rub evenly into to the meat to get the flavor inside as much as possible. There are lots of recipes for rubs around, but odds are you have everything you need to make your own great rub in your kitchen right now. Start with what you like, look through some recipes and then experiment.
As I said, a rub should be worked into meats completely. When applying a rub to poultry try and get it in under the skin. Skin blocks flavors so putting a rub on the surface of skin won't do much for the meat. If is also good to apply your rub well before you plan to grill or smoke. A good hour will be enough in most cases, but large roasts, whole poultry, or briskets should be rubbed down the night before or at least several hours before hand. This allows the seasonings to mingle with the natural juices of the meat and sink in. Dusting a pork chop with a rub seconds before it hits the grill will result in a well flavored set of burners and a good supply of smoke from burning spices. It won't add a lot of flavor to the chops.