Recently, task offloading in the Internet of Drones (IoD) is considered one of the most important challenges because of the high transmission delay due to the high mobility and limited capacity of drones. This particularity makes it difficult to apply the conventional task offloading technologies, such as cloud computing and edge computing, in IoD environments. To address these limits, and to ensure a low task offloading delay, in this paper we propose PSO BS-Fog, a task offloading optimization that combines a particle swarm optimization (PSO) heuristic with fog computing technology for the IoD. The proposed solution applies the PSO for task offloading from unmanned aerial vehicles (UAVs) to fog base stations (FBSs) in order to optimize the offloading delay (transmission delay and fog computing delay) and to guarantee higher storage and processing capacity. The performance of PSO BS-Fog was evaluated through simulations conducted in the MATLAB environment and compared against PSO UAV-Fog and PSO UAV-Edge IoD technologies. Experimental results demonstrate that PSO BS-Fog reduces task offloading delay by up to 88% compared to PSO UAV-Fog and by up to 97% compared to PSO UAV-Edge.