We investigate the behavior of null geodesics near future null infinity in asymptotically flat spacetimes. In particular, we focus on the asymptotic behavior of null geodesics that correspond to worldlines of photons initially emitted in the directions tangential to the constant radial surfaces in the Bondi coordinates. The analysis is performed for general dimensions, and the difference between the four-dimensional cases and the higher-dimensional cases is stressed. In four dimensions, some assumptions are required to guarantee the null geodesics to reach future null infinity, in addition to the conditions of asymptotic flatness. Without these assumptions, gravitational waves may prevent photons from reaching null infinity. In higher dimensions, by contrast, such assumptions are not necessary, and gravitational waves do not affect the asymptotic behavior of null geodesics.