It shares borders with Minas Gerais , EspÃ rito Santo and SÃ # o Paulo as well as the Atlantic Ocean . Rio de Janeiro is the only state in the Southeast to share borders with all the other states in the same Southeast macroregion : Minas Gerais ( N and NW ) , EspÃ rito Santo ( NE ) and SÃ # o Paulo ( SW ) . It is bounded on the east and south by the Atlantic Ocean .