Market risk, which is relevant for stocks held in well-diversified portfolios, is defined as the contribution of a security to the overall riskiness of the portfolio. It is measured by a stock’s beta coefficient, which measures the stock’s volatility relative to the market.
Run a regression with returns on the stock in question plotted on the y axis and returns on the market portfolio plotted on the x axis.
The slope of the regression line, which measures relative volatility, is defined as the stock’s beta coefficient, or b.