Mashing is the process of immersing the milled barley (grist) in water so as to convert the starch in the ground up endosperm into smaller sugars. The resulting liquor is called wort. When you brew from extract, you are using a concentrated form of wort, much like using frozen orange juice to make orange juice.
The goal of mashing or dilluting an extract, to create wort, is to provide an environment in which yeast will thrive. Sugars in the milled barley are in long chains, which are unfermentable. The mash process allows you to extract fermentable sugars from the grist, or milled grains, by dissolving starches and then breaking the starch chains up using enzymes developed in the malting stage.
The processes described here will work well in any of the mash tuns described in the equipment section.
What Happens? 
Conversion of barley starch into sugars is primarily the result of two types of enzymes - alpha amylase and beta amylase. Both enzymes break the chains of glucose which form starch at alpha 1,4 linkages. Alpha amylase breaks these bonds at random points in the starch chain. In contrast, beta amylase acts on the bond between the last 2 and 3 glucose residues in the starch chain, releasing the disacharide sugar maltose.
It may help to imagine alpha amylase as an enzyme that breaks chains in half, while beta enzymes merely nibble at the ends. Alpha enzymes will quickly turn starch chains into fermentable sugars, whereas beta enzymes, given the same amount of time to work, will leave a lot more of the longer, unfermentable chains. The more of the longer chains left in the wort, the thicker or fuller the final beer will feel when consumed. However, with more of the smaller chains, or fermentable sugars, the beer will turn out with a higher alcohol content. The relative effect of each of these enzymes is determined by the temperature - alpha amylase has an optimum temperature of 68 degrees C, while beta amylase has an optimum of 65 degrees.
The following seems unneeded in a homebrewer's guide, but I could not bring myself to delete it. Perhaps this information could be rewritten to have more value to a reader just wanting to brew beer
Limit dextrins are non-fermentable sugars which are produced from the parts of the starch molecule which are branched (ie contain alpha 1,6 linkages). The enzyme which removes the alpha 1,6 branch (in the branched small sugars, not the original starch) is called limit dextrinase, and is destroyed by the high temperatures of mashing (typically 65 degrees C or more), although it is active at lower temperatures. The limit gravity, or residual sugar present after complete fermentation, is in part determined by these limit dextrins. Brewers can control the limit gravity by:
- minimising the time that the mash is at the temperature at which beta amylase is active, as this will convert larger limit dextrins into smaller ones
- adding adjuncts with varying degrees of branching in their starch chains.
- minimising the time the mash is at lower temperatures where limit dextrinase is active (eg protein rest)
Additional processes that can occur during mashing are
- proteolysis (if there is a protein rest stage at 50 degrees C)
- destruction of the beta glucan layer which protects the starch granules
- colour is extracted from the malt
Mashing systems (techniques) 
There are various mashing techniques and the choice of technique is linkd to the equipment available, the level of expertise, the beer style produced, the level of process control and the number of brews to be produced per day.
Iso-thermal Infusion Mash 
The iso-thermal infusion mash is the simplest way to make wort, however, since the technique lacks a protein rest, it is recommended that you use mostly well modified malts. The infusion mash is also referred to as the one-step mash, since the process requires only one step.
Iso-thermal obviously refers to the single mash temperature. In this system mash conversion (the malt starch is converted to sugars) takes place in the same vessel as wort separation. As there are no heating stages it is not necessary to have an agitation in the mash tun.
The ideal situation you want is to attain is one in which your mash rests at a temperature between 66° and 70° C (150°-158° F) to allow the amylase enzymes to do their work. The colder the rest, the more fermentable sugars will be available for fermenting, and therefore the higher alcohol content in the final beer. The hotter the temperature, the more unfermentable sugars will reach fermentation, and thus the fuller the mouth-feel. This is, of course a comparison of otherwise duplicate mashes. Remember, the enzymes will work outside their optimum temperatures, so given an adequate amount of time, all starches can be converted to fermentables.
For an infusion mash, mix a measured amount of hot water in a container with your grist (milled malt) and allow the mash to rest for 30 to 60 minutes. For every pound of grain, you will use 1 quart of water. At this ratio, the mash will stabilize at a temperature 9°-10° C (16°-18°F) lower than the temperature water added. For example, adding 10 quarts of water at a temperature of 78°C (172°F) to 10 lbs of grist will stabalize at a temperature of 68°-69°C (154°-156°F). You will be well served to take temperature readings at regular intervals to make sure you are maintaining the optimal temperature range. Adding small amounts of hot water to bring the temperature back up is permitable, however avoid bringing the temperature too high as the higher temperatures will negatively affect enzymatic activity, just as much as too low.
Decoction Mash 
Decoction mash is the most complex technique used to extract sugars from grain. The technique was born out of the lack of accurate temperature measurements, with the only accurate points of measurement being freezing point of water (0° C or 32° F), blood temperature (~36°C or 98°F), and the boiling point of water (100°C or 212°F). This method also is believed to result in better yield. However, because of the complexity, and the unlikelihood of a homebrewer choosing to use decoction, detailed instructions will not be given here at this time.
The basic method begins by infusing a measured amount of boiling water with water and grist at blood temperature to bring the mash up to the initial rest temperature. This initial rest can be an acid rest, or the mash could begin with a protein rest. Near the end of this rest a measured amount of water and grist is stolen from the mash, heated to a boil, and then returned to the main mash to bring the temperature up to the next temperature rest. This process is called decoction. Sometimes, when an extended rest time is expected, the mash is decocted again, or even a few more times to maintain rest temperature.
Step Mash 
If you are planning to use undermodified malts, or just simply want a better quality product, the Step Mash (or Program mash or Temperature-Controlled Step Infusion Mash), is only slightly more complicated than iso-thermal mashing. There can be two or three steps, or rests, in your mash.
- Proteolytic stand Mashing takes place to achieve a strike temperature of about 50°C (122°F) and held there for roughly a half hour for the protein rest.
- Saccharification stand The mash is brought to 63°- 65°C (150°-158°F),(20 to 60 minutes depending on the required fermentability of the wort) for the beta-amylase to produce the fermentable maltose sugars for another half hour.
- Conversion stand The mash is raised to 71 - 72°C (about 20 minutes) for the alpha amylase to break down any large starch particles and to achieve starch conversion. The end of this stand is confirmed with the starch test - see below.
- Mash out stand the mash is finally raised to 76°C for 5 minutes to denature all mashing enzymes.
In practice, for every pound of grist in the mash, you will use 1 liter (1 qt) of water at 54°C (130°F) to get the mash to the initial protein rest. Then, for each pound of grist, you will use .5 liter (½ qt) of 93°C (200°F) water to raise the temperature 10°C (18°F). These are rough figures, since the more water added, the larger the volume, and therefore the more water required to raise the temperature a comparable amount. However, if you use these figures to figure the amounts needed, you will be pretty well off.
End of mashing 
Mashing usually takes about 30 minutes with a typical pale malt - however times may be more or less depending on the enzymatic activity (diastatic) power of the malt.
To test for mash conversion we test for the presence of starch: this can be done by mixing 1g of Lite salt (potassium iodide) with 50 ml 3% iodine solution and adding a drop to a sample (a teaspoon full) of the mash. If it turns deep blue starch is present.
Unconverted mash 
If you continue to get starch, even hours after mashing, then the milling of the grain may be at fault in that the starch isn't being broken up enough to allow the enzymes to access it. High mash temperatures may have de-natured the malt enzymes.
Special mashing techniques 
Grain steeping 
The most basic way to extract flavors from specialty grains is by steeping them in warm water.
The simplest way to perform this is to add the crushed grains (in a nylon or cotton grain bag) to the (cold) brewing water as is it brought to boiling temperature. The grains should be removed before the temperature reaches 170°F to prevent the extraction of too many tannins. Dip the bag in and out a few times and let it drip for about 15 seconds before discarding. Do not squeeze the bag. Squeezing will also extract too much tannin from the grain husks.
Alternatively, the crushed grains are steeped in 2-3 gallons of 150°F water for 30 minutes before being removed from the wort. This allows for a more complete extraction.
Partial mash 
Not much more difficult than steeping is the "Partial mash" or "Mini-Mash" procedure, which utilizes emzymatic malts in addition to the specially grains and will result in a much better extraction of flavors and colors.
Start by setting your oven to the "warm" (or lowest) setting. We are looking to a achieve a temperature of between 140 and 160°F. If the temperature of your oven is higher than 160°F at this setting, simply turn off the oven before placing the mash pot inside. The thermal mass of the hot grains and water should maintain a proper temperature during mashing.
Heat between 1 and 3 quarts of water per pound of crushed grain that will be used to a light boil. Remove from the heat, allow to cool to 160-170°F, and transfer to your mash vessel and mix in the crushed grains. Mix thoroughly to be sure that the grains are not clumped then place the mash vessel in the oven for 45 to 60 minutes. Do not open the oven door while mashing is in progress or a significant amount of heat will escape. Do not let the mash temperature fall below 145°F. An oven themometer with a probe will allow you to monitor the temperature, although this is usually not necessary.
While the mashing is taking place, heat an additional 1 to 3 quarts of water per pound of crushed grain (roughly the same amount you used for mashing) to a light boil, remove from the heat, and allow to cool to 140-170°F. This will be your sparge water.
Once the mashing process is complete strain the mash into your brew pot using a stainless steel colander (pasta strainer). Then, slowly and evenly pour the sparge water over the mash. The mash is now complete.
""Add an amount water necessary to your brew pot to get up to the volume of water you traditionally use for your extract brewing.""