US stocks gain on Nike earnings, Apple rally