To replace every occurrence of a piece of text from the cursor to the end of the file:
1. Type M-R.
2. Type in the text you want to replace and press the META key.
You will then be prompted for the new text, with a prompt like this:
3. Type in the new text and press the META key
All the occurrences of the old text will be replaced by the new and the number of changes printed at the bottom of your screen, for example: