Replace string in line below specific pattern?

Hi,

I'm trying to replace a string with sed, in a text file containing this pattern:

location alpha
    value x
location beta
    value y
location gamma
    value y
location delta
    value y
location theta
    value z
...

What I want to achieve is:
Find location beta into text file and replace value y with value s. Note that beta, gamma and delta locations share the same value. I want to replace the value based on a specific location.

This is a short example, I have about 100 unique locations randomly displayed into file, with several of them having identical values.

Thank you.

Try for given input this should work

$ sed -r -e '/^location beta/ { n ; s/y/s/ }' file
location alpha
    value x
location beta
    value s
location gamma
    value y
location delta
    value y
location theta
    value z
...