Fog computing uses near-user edge devices that are usually smart devices with very limited storage and computation resources; hence, the authentication process should be lightweight to be suitable for fog computing environment. In this paper, a Lightweight Anonymous Mutual Authentication Scheme (LAMAS) for securing fog computing is proposed based on elliptic curve cryptography. The proposed scheme succeeds to achieve mutual authentication between fog users and the fog servers even if the fog server is added after user registration, without need to re-register or do any more computation. Additionally, the fog user's identity is totally hidden and cannot be predicted due to the Elliptic Curve Discrete Logarithm Problem (ECDLP). Moreover, formal and informal security analysis is conducted to prove the security of the proposed scheme. Furthermore, comparisons with related schemes are carried out to demonstrate the superiority and efficiency of the proposed scheme in terms of computation cost and storage requirements.