Scientists are using light to switch molecules between different states in very tiny spaces. This could lead to faster optical memory and light-controlled electronic devices.