How do you calculate the beta of a stock?

How is beta calculated for a stock, and what does it indicate about volatility?,