The three conditions
A beam of light is not visible from the side unless something is in the way. Air alone scatters very little, so what you are actually looking at when you see a shaft is illuminated particles suspended in it. That gives three requirements, and all three have to be present.
A hard, distant source. Low sun is the classic case. A soft or nearby source produces a wash rather than defined edges, because the beam's boundaries depend on the source being effectively a point.
An occluder with gaps. Cloud, tree canopy, a window frame, slats, a doorway, a colonnade. The gaps are what turn one volume of light into separate shafts, and their shape is the shape of the beams.
Particles in the air. Dust, haze, mist, smoke, sea spray, fine rain. This is the condition that is missing most often, and it is why the same room looks ordinary in the morning and spectacular when someone sweeps the floor.
The formal name, crepuscular rays, records the most common natural case: the sun low near dawn or dusk, shining through broken cloud. The informal name records the effect on viewers, since beams breaking through cloud were the standard way to depict divine presence in European painting for centuries, and the association survived into film.
The trade you are making
Atmosphere is not free. The same particles that reveal the beams also scatter light everywhere else, which lifts the shadows, lowers overall contrast and reduces saturation. That is a real exchange rather than a side effect to be fixed later.
Cinematographers manage it by keeping the atmosphere as sparse as the shot can tolerate and by lighting for contrast elsewhere, often underexposing everything the beam does not touch. The look people admire is not hazy: it is a very dark frame with a few bright shafts crossing it, and the darkness is what makes the shafts read.
Prompting them
This is one of the most commonly over-supplied effects in generated images. Asking for god rays typically returns a soft, milky, low-contrast picture with vague bright areas, because the model provides atmosphere generously and beams vaguely.
Three clauses fix most of it.
Name the occluder and the number of beams: hard low sun through gaps in a boarded window casting three defined light shafts. Specifying a count and a source of the gaps is what turns a wash into shafts, and the word defined does real work.
Give each beam a destination. Each beam landing as a bright patch on the concrete floor forces the model to treat the shafts as geometry travelling through space rather than as a texture laid over the image.
Protect everything else: everything else in deep shadow. Without this the haze raises the black level across the frame and the beams stop standing out, which is the single most common failure.
For video, expect the beams to be the least stable part of the shot. Atmosphere drifts frame to frame, so slow camera moves and short clips hold together far better than long moving takes.