Let a tetrahedron $ABCD$ be inscribed in a sphere $S$. Find the locus of points $P$ inside the sphere $S$ for which the equality
\[\frac{AP}{PA_1}+\frac{BP}{PB_1}+\frac{CP}{PC_1}+\frac{DP}{PD_1}=4\]
holds, where $A_1,B_1, C_1$, and $D_1$ are the intersection points of $S$ with the lines $AP,BP,CP$, and $DP$, respectively.
1. **Define the problem and given conditions:**
   - A tetrahedron \(ABCD\) is inscribed in a sphere \(S\) with center \(O\) and radius \(R\).
   - Points \(A_1, B_1, C_1, D_1\) are the intersections of the lines \(AP, BP, CP, DP\) with the sphere \(S\), respectively.
   - We need to find the locus of points \(P\) inside the sphere such that:
     \[
     \frac{AP}{PA_1} + \frac{BP}{PB_1} + \frac{CP}{PC_1} + \frac{DP}{PD_1} = 4
     \]

2. **Express the given condition in terms of distances:**
   - Since \(A_1, B_1, C_1, D_1\) are points where the lines \(AP, BP, CP, DP\) intersect the sphere again, we have:
     \[
     PA_1 = 2R - PA, \quad PB_1 = 2R - PB, \quad PC_1 = 2R - PC, \quad PD_1 = 2R - PD
     \]
   - Therefore, the given condition can be rewritten as:
     \[
     \frac{AP}{2R - AP} + \frac{BP}{2R - BP} + \frac{CP}{2R - CP} + \frac{DP}{2R - DP} = 4
     \]

3. **Simplify the expression:**
   - Let \(PA = x\), \(PB = y\), \(PC = z\), \(PD = w\). Then:
     \[
     \frac{x}{2R - x} + \frac{y}{2R - y} + \frac{z}{2R - z} + \frac{w}{2R - w} = 4
     \]
   - Multiply both sides by the denominators to clear the fractions:
     \[
     x(2R - y)(2R - z)(2R - w) + y(2R - x)(2R - z)(2R - w) + z(2R - x)(2R - y)(2R - w) + w(2R - x)(2R - y)(2R - z) = 4(2R - x)(2R - y)(2R - z)(2R - w)
     \]

4. **Use geometric properties and theorems:**
   - By Leibniz's theorem for a tetrahedron, we have:
     \[
     PA^2 + PB^2 + PC^2 + PD^2 = 4PG^2 + \frac{1}{4}(a^2 + b^2 + c^2 + d^2 + e^2 + f^2)
     \]
     where \(G\) is the centroid of the tetrahedron and \(a, b, c, d, e, f\) are the edges of the tetrahedron.
   - Similarly, for the distances from the center \(O\) of the sphere to the vertices:
     \[
     OA^2 + OB^2 + OC^2 + OD^2 = 4OG^2 + \frac{1}{4}(a^2 + b^2 + c^2 + d^2 + e^2 + f^2)
     \]

5. **Combine the equations:**
   - From the above equations, we get:
     \[
     PA^2 + PB^2 + PC^2 + PD^2 = 4PG^2 + 4R^2 - 4OG^2
     \]
   - Equating this with the earlier expression:
     \[
     PA^2 + PB^2 + PC^2 + PD^2 = 4(R^2 - PO^2)
     \]
   - Therefore:
     \[
     4PG^2 + 4R^2 - 4OG^2 = 4(R^2 - PO^2)
     \]
     \[
     PG^2 + PO^2 = OG^2
     \]

6. **Interpret the result:**
   - The equation \(PG^2 + PO^2 = OG^2\) implies that \(\angle OPG = 90^\circ\).
   - Hence, the locus of points \(P\) is the spherical surface with diameter \(\overline{OG}\).

The final answer is the spherical surface with diameter \( \boxed{ \overline{OG} } \).