Augmenting mkm's answer a bit. In addition to working on 2 marked files potentially across dired buffers, it handles the case when there are 0 or 1 marked files. 0 marked files will use the file under the cursor as file A, and prompt for a file to compare with. 1 marked files will use the marked file as file A, and prompt for a file to compare with. The file under the point is used as the default in the prompt. I bound this to =.
(defun mkm/ediff-marked-pair ()
"Run ediff-files on a pair of files marked in dired buffer"
(interactive)
(let* ((marked-files (dired-get-marked-files nil nil))
(other-win (get-window-with-predicate
(lambda (window)
(with-current-buffer (window-buffer window)
(and (not (eq window (selected-window)))
(eq major-mode 'dired-mode))))))
(other-marked-files (and other-win
(with-current-buffer (window-buffer other-win)
(dired-get-marked-files nil)))))
(cond ((= (length marked-files) 2)
(ediff-files (nth 0 marked-files)
(nth 1 marked-files)))
((and (= (length marked-files) 1)
(= (length other-marked-files) 1))
(ediff-files (nth 0 marked-files)
(nth 0 other-marked-files)))
((= (length marked-files) 1)
(let ((single-file (nth 0 marked-files)))
(ediff-files single-file
(read-file-name
(format "Diff %s with: " single-file)
nil (m (if (string= single-file (dired-get-filename))
nil
(dired-get-filename))) t))))
(t (error "mark no more than 2 files")))))