Application opens twice when file specified

You have to enclose the document you're trying to open in quotes

open -a emacs "/foo/bar/foobar.txt"