Let \( x \) be the cost of each pen. Amir bought a comic book for $9 and four pens, which means he spent \( 4x \) on the pens. The total amount he spent is represented by the equation:
\[ 9 + 4x = 25 \]
To solve for \( x \), first, subtract 9 from both sides:
\[ 4x = 25 - 9 \] \[ 4x = 16 \]
Next, divide both sides by 4:
\[ x = \frac{16}{4} \] \[ x = 4 \]
Therefore, each pen costs \( \boxed{4} \) dollars.