Penril Corp., a Rockville-based electronics firm, has won a $4 million contract to provide low-cost communications modems to Atari, the nation's largest manufacturer of personal computers and videogames.

A modem is a device that enables a computer to communicate over telephone lines with other computers. This lets the computer link to information networks such as The Source and Compuserve. Penril is expected to ship roughly 100,000 modems by the middle of next year, with delivery beginning this July.

The contract is the largest in Penril's 15-year history, and it may be significant for Atari's aspirations in the personal-computer marketplace because it would allow the company to price its modems at less than $100, a significant reduction in current modem prices. However, a production run of only 100,000 modems may indicate that Atari does not believe the devices are ready for a mass market but rather as accessories for the base computer.

This manufacturing contract to Penril may be viewed as unusual in light of Atari's recent decision to lay off 1,700 American employes and shift its manufacturing operations to Asia. An Atari representative confirmed the Penril contract but would not discuss details. Atari is a division of Warner Communications Inc.

Penril, which grossed $40 million in revenues in 1982, has approximately 800 employes.