you can use base R:
a = sapply(1:(length(x)-1),function(x)x:(x+1))
colMeans(structure(x[a],.Dim=dim(a)))/colMeans(structure(y[a],.Dim=dim(a)))
[1] 2 2 2 2
or even
 tapply(x[a], col(a), mean)/tapply(y[a], col(a), mean)
These base functions seem to work faster than the rollapply since the rollapply will do the rollapply twice:
microbenchmark::microbenchmark(
   COLMEANS={a=sapply(1:(length(x)-1),function(x)x:(x+1))
   colMeans(structure(x[a],.Dim=dim(a)))/
     colMeans(structure(y[a],.Dim=dim(a)))},
   ROLLAPPLY=rollapply(x,2,mean)/rollapply(y,2,mean),
   TAPPLY={a=sapply(1:(length(x)-1),function(x)x:(x+1))
     tapply(x[a], col(a), mean)/tapply(y[a], col(a), mean)
   },
   ROLLMEANS=rollmean(x,2) / rollmean(y,2)
 )
 Unit: microseconds
      expr      min        lq      mean   median        uq      max neval
  COLMEANS   76.517  109.0040  187.7223  138.499  178.0405 4598.685   100
 ROLLAPPLY 1752.185 1954.8040 2144.2619 2028.543 2211.9260 6244.430   100
    TAPPLY  398.827  519.3725  665.5016  604.224  682.4505 5304.859   100
ROLLMEANS 1366.610 1619.6715 1815.3349 1731.0260 1957.7965 2615.240   100