Beyond buying or selling companies for their intrinsic value, one way of trading is by buying and selling firms against their peers. The basic theory here is that firms in like industries should revert to a mean pricing metric. The idea is that, beyond minor idiosyncrasies, two companies operating in the same market and environment should cost the same. Now, obviously, it isn't as simple as just saying $50 is more than $10, so rather than using pure price, you would use a ratio (normalizing stock price). A variety of ratios exist and it is up to your research to figure out what are most effective (ideally backtesting your theory to see if you would have been right, historically).
Two very popular ratios are Price to Earnings per Share and Price to Book Value per Share. Price to Earnings Ratio (P/E Ratio) measures how much you are paying per dollar earned by the firm. This is usually a better metric for industries where you expect growth, as the idea here is you are willing to pay more for current earnings because you expect earnings to grow in the future. Price to Book Value Ratio (P/BV Ratio) is better for value stocks, as you do not expect earnings to grow immensely, rather you are paying a premium on the common equity to have access to dividends and stability.
While this is not a recommendation on what is always appropriate, as examples, we can use the P/E Ratio to take a look at semiconductor stocks and P/BV Ratio for utility stocks to try and see what looks overpriced and underpriced by the market. The key word here is 'priced' as we are not making a call on the intrinsic value of the firm. To elaborate, think of price as being determined by the market's biases and value as being determined by the firm's activities – at times not aligning. Taking a look at semiconductors, and ignoring Microchip Technology Incorporated's current P/E of 247, we see an average P/E Ratio of 22. Looking at a line of best fit, currently the most overpriced is Nvidia Corp and the most underpriced First Solar. If we believed the ratios should revert to the mean, we would sell Nvidia and buy First Solar. For utility stocks, we get an average P/BV Ratio of 1.93. Here, the most overpriced seem to be CenterPoint Energy and Dominion Resources with the cheapest being FirstEnergy and Duke Energy. In this instance, we may sell CenterPoint and Dominion while buying FirstEnergy and Duke.
Often, ratio trades will work, though with huge variation in amount of time it takes for the market to 'correct'. In some instances, ratios will revert to the mean over a few short weeks (suggesting an overreaction to an event), other times a few long years (suggesting there was a unique advantage/disadvantage to the firm which has diminished). You may be 'right', just maybe not right now. Take heed, take caution, and remain liquid.