This feature should work out-of-the-box, provided that
TeX-master is correctly set. The format of that variable is described at
(info "(auctex)Multifile"). In particular, in the secondary files
TeX-master should be a string with the relative path to the master file, without extension. Thus, if your master file is called
main.tex and resides in the same directory as the secondary files you should have
%%% TeX-master: "main"
with quotes around
Note that there is a handy function that can help you to insert the right value of
TeX-master-file-ask, bound to C-c _.
Note also that it's strongly suggested to put the line
(setq-default TeX-master nil) ; Query for master file.
in your init file, so that you'll be always prompted for the master file (just press RET to select the current file as master file) every time you create a new *TeX file.
While we are at it, add to your init file also the lines
(setq TeX-parse-self t) ; Enable parse on load.
(setq TeX-auto-save t) ; Enable parse on save.
to enable all the parsing infrastructure that makes AUCTeX great. All these settings are suggested in the very first lines of the AUCTeX manual.