Auto Mask in Camera Raw
If you select the Adjustment Brush in Camera Raw to apply a localised adjustment, there is an Auto Mask option at the bottom of the Adjustment Brush panel. When checked, this constrains the brush strokes to areas of colour that are similar to where you first clicked. As you paint you can re- click to clear the original sample colour to make a new sample. You can also refine the selection by holding down the Option key (Mac), or Alt key (PC) to erase in Auto Mask mode. In this way you can build up a masked selection in Camera Raw. Having done that you can fine-tune the Adjustment Brush settings to apply the desired adjustment. Watch out for speckled edges though. These can appear along edges of soft colour transitions and can be particularly noticeable when applying strong tone and colour adjustments.
Use the Auto Mask option to constrain the brush strokes