What makes a gene dominant or recessive
On the molecular level, genes most often encode proteins which perform some function for the cell: For example, they could be enzymes and catalyze chemical reactions. They could also have some structural function, such as make up the "muscle" part of your muscle cells... You get the idea. 

In the most simple case, the dominant allele encodes a protein that can perform its function. For example, the dominant allele for the CFTR gene encodes a channel that can let chloride into and out of the cells. The recessive allele, on the other hand encodes a protein that cannot do its job correctly (this also called a loss-of-function mutation). So if you inherit a functional copy from one parent and a non-functional copy from the other parent, you will still have one copy of the protein that can do its job. Only if you get a nonfunctional copy from both parents will you have a recessive condition called cystic fybrosis.

On the molecular level a gene can also encode a dominant-negative variant of a protein. In this case the protein cannot do its job and also prevents the functional version of the protein to do its job too.

A third way this could work is by a gain-of-function mutation. In this case, the gene encoding a protein acquires a mutation that gives a new function to the protein. For example, in Huntington's disease, the mutant Huntingtin protein acquires the ability to clump together in large plaques, which are poisonous to some neurons in the brain. Since it takes only one copy of the protein to perform the new function, the gain-of-function allele is a dominant one.

These are only a few examples that deal with simple dominant and recessive inheritance. Most often there are more complex mechanisms of inheritance at play.