Counting the number of words containing a specific subword, and not another subword Consider the $10$ letter word
$$PRRAAAATTM$$
and all the words formed by rearranging its letters. How many of these words contain the subword $RAT$ but do not contain the subword $MAP$?  
This is what I tried:  
Let $R$ be the set of words containing the subword $RAT$.
Let $M$ be the set of words containing the subword $MAP$.  
Then I want to compute $|R-M| = |R| - |R\cap M$|.  
To count $|R|$, we count the number of words containing at least one $RAT$, and subtract the number of words containing  $RAT$ at least twice + number of words containing $RAT$ at least three times - number of words containining $RAT$ at least four times - ... and so on.  
Since only two $RAT$'s are possible, then
$|R|$ = number of words containing at least one $RAT$ -  number of words containing two $RAT$'s.  
Number of words containing at least one $RAT$ is
$$\binom{8}1 \times \frac{7!}{3}$$
and number of words containing two $RAT$'s is
$$\binom{6}2 \times \frac{4!}{2!}.$$
So
$$|R| = \binom{8}1\times\frac{7!}{3!} - \binom{6}2\times\frac{4!}{2!}
$$
Now   with similar reasoning,
$$|M\cap R| = \binom{6}2\times\frac{4!}{2!} - \binom{4}3
$$
So
$$|R-M| = \binom{8}1\times\frac{7!}{3!} - 4!\times\binom{6}2 + \binom{4}3$$

@mathlove has provided you with a nice answer.  Here is an alternative approach:
Number of words containing RAT:  We have eight objects to arrange: RAT, A, A, A, M, P, R, T.  We can choose three positions for the As, then arrange the remaining five distinct objects in the remaining five places in 
$$\binom{8}{3}5!$$
ways.
Number of words containing two RATs:  We have six objects to arrange: RAT, RAT, A, A, M, P, R.  We choose two of the six positions for the RATs, two of the remaining four positions for the As, then arrange the remaining two distinct objects in the remaining two places in 
$$\binom{6}{2}\binom{4}{2}2!$$
ways.  
Hence, 
$$|R| = \binom{8}{3}5! - \binom{6}{2}\binom{4}{2}2!$$
Number of words containing RAT and MAP:  We have six objects to arrange:  MAP, RAT, A, A, R, T.  We can choose two of the six positions for the As, then arrange the remaining four distinct objects in the remaining four positions in 
$$\binom{6}{2}4!$$
ways.
Number of words containing two RATs and MAP:  We have four objects to arrange: MAP, RAT, RAT, A.  We can choose two of the four positions for the RATs, then arrange the remaining two distinct objects in the remaining two positions in 
$$\binom{4}{2}2!$$
ways.  
Hence, 
$$|M \cap R| = \binom{6}{2}4! - \binom{4}{2}2!$$
Therefore,
$$|R - M| = |R| - |M \cap R| = \binom{8}{3}5! - \binom{6}{2}\binom{4}{2}2! - \left[\binom{6}{2}4! - \binom{4}{2}2!\right]$$ 
