Remove the California king-size mattress to gain access to the rails.
Shake the rails from side-to-side with your hand to reveal any squeaking or loose bolts and screws.
Replace any bent bed rail hangers with new ones. The bed rail hangers are the metal hooks that connect the cross bars to the cross arms. Remove the bolts or screws securing the bent hanger and replace it with a new one.
Tighten any loose bolts or screws in the rails. Replace any bolts or screws that are bent with new ones. Rails that are tightly secured will not shift as easily.
Lubricate the connecting metal parts with WD-40 to keep them from grinding against each other and squeaking. For wood rails, smooth wood wax between two moving parts to reduce grinding.