A rational Arnoldi process with applications