Diodes are the most basic semiconductor. A diode simply allows electricity to flow only one way.They allow current to flow through them when the side marked with a + in the picture below has a higher voltage then the side marked with a -.
A diode can be thought of as a check valve, they only let water though one way.
How Diodes Work
Silicon is special in that it is a semiconductor, meaning it conducts electricity in some circumstances but not others. Silicon can be mixed with small amounts of impurities to give it a charge. This is called doping.To give the silicon a positive charge small amounts of boron are mixed into it, for a negative charge it is mixed with something like phosphorous. A diode consists of two pieces of silicon, a n-type(-) and a p-type(+).
When a positive voltage is applied to the p-type side the like charges repel and it creates a conductive path past the P-N junction (where P and N touch). However if a negative charge is applied to the p-type side then the opposite charges attract creating an electrical "hole" at the P-N junction, blocking the flow of electrons.
When positive voltage is applied to the P-type side of the diode it takes a specific amount of voltage before it can create the conducting bridge. The lowest voltage at which the diode starts conducting is called the forward voltage. A diode typically has a forward voltage of around 0.7V. This also means that the voltage across the diode will be 0.7V, so you will lose 0.7V. If you have a 5V connected to the P-type side then the voltage from the N-type side to ground will be the difference between 5V and the forward voltage, 4.3V. There are special diodes know as Schottky diodes that have a very low forward voltage, however they are usually more expensive and can not handle as much current.