First make sure mencoder is installed. The syntax is very simple. This command line encodes the sample.rm file with the libav codec (the best divx codec for both performance and quality) and the soundtrack with mp3lame:
mencoder -ovc lavc sample.rm -oac mp3lame -o sample.avi