When a star reaches the red giant stage in the course of its evolution, its closest planets are in its atmosphere. Numerical gas dynamic models are constructed for hypersonic flow around planets by matter in the atmosphere of a red giant. The results are compared with analytic models for the motion of planets in the atmospheres of stars.