Rectangles occur when the price moves between two parallel horizontal support and resistance levels. The rectangle pattern is a continuation pattern that occurs midway during a trend. The price moves quite strictly between the two levels forming the rectangle.
The rectangle usually indicates a continuation of the pattern so during an uptrend it usually indicates the price will move up once it breaks through the upper level or during a downward trend it most likely will breakout downward. It should be noted that while rectangles usually signal a continuation they can represent a period of indecision as well as consolidation so it is possible that a reversal can occur. This is also the reason that in order to trade a rectangle pattern you should wait for a convincing breakout through the support/resistance levels before entering the market.