To write in a name in Montana, voters are instructed to blacken the oval to the left of the line provided, and write in the name in the blank space for the write-in candidate for whom the voter wishes to vote.

You can also watch an instructional video here (Quicktime video) which describes how to use the “AutoMark” voting machine in Montana to write-in a candidate.