For males only:
yDNA looks at the DNA that a man inherits from his father's (paternal) side.
The y-chromosome is compared from two or more men to see if they share a common male ancestor.
Females can find a male to represent their line in the surname of interest.
For males and females:
mtDNA looks at the DNA that either a man or woman inherits from the mother's mother's side.
The mitochondria is compared to see if they share a common female ancestor in their maternal lineage.
This test can also be used to explore your ethnicity.