Let $A$ be a commutative ring with identity and let $M$ be an $A$-module. The fiber of $M$ at $P \in \text{Spec}A$ is the module $M(P):=M_P / PM_P$, which is a vector space over the residue field $A(P)=A_P / PA_P$. My question is, how does this scalar multiplication look like? I believe it is induced by the multiplication as we consider $M_P$ as an $A_P$-module?
Later I am supposed to prove that if $M$ is finite, then $rk_M(P)$ is finite where $rk_M$ is the function $$rk_M : \text{Spec} A \to \mathbb{N} \cup \{ \infty \}$$ given by $$P \mapsto \dim_{A(P)} M(P)$$ Before trying to prove this, I am trying to understand the structures $M(P)$ and $A(P)$ and how the vector space thing works, can anyone bring clarity to this?