Antibodies (also called immunoglobulins) are large Y-shaped proteins that can stick to the surface of bacteria and viruses. They are found in the blood or other body fluids of vertebrates. Antibodies are the key element in the adaptive immune system.

The antibody recognizes a unique part of the foreign target called an antigen. Each tip of the "Y" of an antibody contains a structure (like a lock) that fits one particular key-like structure on an antigen. This binds the two structures together.

Using this binding mechanism, an antibody can tag a microbe or an infected cell for attack by other parts of the immune system, or can neutralize its target directly. The production of antibodies is the main function of humoral immunity.

Each antibody is different. They are all designed to attack only one kind of antigen (in practice, this means virus or bacteria). For instance, an antibody designed to destroy smallpox is unable to hit the bubonic plague or the common cold.

Though the general structure of all antibodies is very similar, that small region at the tip of the protein is extremely variable. This allows millions of antibodies with different tip structures to exist. Each of these variants can bind to a different antigen. This enormous diversity of antibodies allows the immune system to recognize an equally wide variety of antigens.

Immunoglobulin diversity

Basic issue 
Although a huge variety of different antibodies is made in a single individual, the number of genes available to make these proteins is limited by the size of the genome.

There are a vast number of microbe strains, and so vertebrates need millions of different antibodies.  Actually, humans generate about 10 billion different antibodies, each capable of binding a distinct antigen site. This must be done with a very much smaller number of genes: the total human genome has only about 20,000 genes.

Several complex genetic mechanisms have evolved. These allow vertebrate B cells to generate a huge pool of antibodies from a relatively small number of antibody genes. The full details are not presented here, just a summary.

The variety of antibodies is got by combining segments from a pool of genes in many different ways. Then, hyper-mutations occur in the binding site area of the antibody gene. This creates further diversity.

Heavy chains 
Antibodies are glycoproteins belonging to the immunoglobulin superfamily; the terms antibody and immunoglobulin are often used interchangeably. Antibodies are typically made of basic structural units—each with two large heavy chains and two small light chains. There are several different types of antibody heavy chains, and several different kinds of antibodies, which are grouped into different isotypes based on which heavy chain they possess. Five different antibody isotypes are known in mammals. They  help direct the appropriate immune response for each different type of foreign object they encounter.

Variable tips 
Though the general structure of all antibodies is very similar,  a small region at the tip of the protein is extremely variable, allowing millions of antibodies with slightly different tip structures, or antigen binding sites, to exist. This region is known as the hypervariable region. Each of these variants can bind to a different antigen. This enormous diversity of antibodies allows the immune system to recognize an equally wide variety of antigens. The large and diverse population of antibodies is generated by random combinations of a set of gene segments that encode different antigen binding sites (or paratopes), followed by random mutations in this area of the antibody gene, which create further diversity. Antibody genes also re-organize in a process called class switching, which allows a single antibody to be used by several different parts of the immune system.

Other websites 
Animated depictions of how antibodies are used in ELISA  and ELISPOT  assays

References 

Cell biology
Immunology