Let's say your upper back is like a rusty hinge and can't get into position to hold the bar properly. This can lead to some neck, shoulder, and upper back pain when trying to squat. The best corrective strategy is to fix the squat itself to improve the mobility and strength being affected.
Focus on getting the chest up and out without letting the bottom ribs flare out ahead of the chest. When this happens, the only extension is coming from the junction point where the thoracic spine meets the lumbar spine, and is a less than optimal compensation pattern around an inflexibility. Try to really bear down on the abs to keep them tense and then press your chest up and out between your shoulders.
The goal isn't to make the movement perfect on the first go around, but to show improvement from the beginning of the set. Steps in the right direction add up to positive change over time.