Betty has between $40$ and $50$ pennies that she wants to arrange in a rectangular array. She notices she can arrange the pennies in three different ways without any gaps or spaces. However, if Betty adds two more pennies to her collection, she can only arrange the pennies in one way without any gaps or spaces: a straight line. How many pennies did Betty originally have?

Note: An $a \times b$ rectangle is considered the same as a $b \times a$ rectangle.
Let the number of pennies that Betty has be $n.$ If after adding two more pennies, Betty can only arrange the pennies in a straight line, then $n+2$ must be prime. Since all primes greater than $2$ are odd, $n$ must be odd as well. Because she can arrange $n$ pennies in three different ways, $n$ must have four factors other than $1$ and itself. Hence we examine the odd numbers between $40$ and $50:$

$\bullet$ $41$ factors as $1 \cdot 41$ only.

$\bullet$ $43$ factors as $1 \cdot 43$ only.

$\bullet$ $45$ factors as $1 \cdot 45$ or $3 \cdot 15$ or $5 \cdot 9$.

$\bullet$ $47$ factors as $1 \cdot 47$ only.

$\bullet$ $49$ factors as $1 \cdot 49$ or $7 \cdot 7$.

The only number with four factors other than $1$ or itself is $45.$ If we add $2$ to $45,$ we get $47,$ which is indeed prime. Hence, Betty has $\boxed{45}$ pennies.